Opening the shared document…
Diagram playground
Write a diagram as text and it renders here as you type. Canvas editing for six of ten notations. Nothing leaves your browser. Syntax reference ·
1
archlab 1.0 dict
2
title "order.placed event"
3
description "The envelope and payload every downstream consumer subscribes to — a contract with no table behind it."
4
5
@dict
6
section "Envelope" [Kafka]
7
desc "Present on every event on the topic, whatever the payload"
8
field event_id uuid required unique
9
desc "Deduplication key. A consumer that has seen this id has already processed the event."
10
values "RFC 4122"
11
field occurred_at timestamptz required
12
desc "When the thing happened, not when the message was produced. Producers retry; this does not change."
13
field version integer required
14
desc "Schema version of the payload below. A consumer must ignore an envelope whose version it does not know."
15
example "3"
16
section "Payload"
17
desc "Version 3. Fields are added, never removed or repurposed."
18
field order_id uuid required
19
desc "The order this event is about."
20
source "orders.order.id"
21
field customer_email string required pii
22
desc "Denormalised onto the event so consumers need no lookup. Personal data — it leaves the boundary with the event."
23
source "accounts.customer.email"
24
field total_minor integer required
25
desc "The order total in MINOR units, to avoid a float. Divide by 100 for a display value."
26
example "128450"
27
field currency string required
28
values "ISO 4217"
29
example "THB"
30
field coupon_code string deprecated
31
desc "Never populated since v2. Read the discounts array instead; this stays for consumers not yet migrated."
Tab indents · Esc then Tab leaves the editor · worked examples
Read-only