Asynchronous event contract for the Order Management bounded context, the generic/supporting context that owns the Order and OrderLine aggregates: order intake, per-line stock allocation (via inventory-storage's reservation API), promise-date calculation, and choreographed release of allocated work (announced to wes-work-planning as facts on Kafka — see ADR 0005).
Every message on every channel below — produced AND consumed, integration AND analytics — is a CloudEvents 1.0 event in Kafka structured content mode (ADR 0030, the fleet-wide standard). There is no flat envelope, no dual-write/dual-read, and no envelope toggle.
application/cloudevents+json); Kafka header
content-type: application/cloudevents+json; charset=UTF-8.specversion (1.0), id (UUID, minted once
and persisted with the outbox row), source
(/warehouse/order-management for everything this service
publishes), type
(com.warehouse.wes.order-management.order.<EventName>), subject
(the order id), time (occurred-at, UTC), datacontenttype
(application/json), dataschema
(urn:warehouse:order-management:<events|analytics>:<EventName>:v1).type names an occurrence on both topics; dataschema
distinguishes the integration payload from the analytics payload.data is the event payload, unchanged by the envelope migration.OrderId (Hash balancer),
preserving per-order ordering. W3C trace context stays in the
traceparent/tracestate headers.Delivery is at-least-once: consumers dispatch on the FULL type,
ignore unknown types, and de-duplicate on id (the projector does
exactly that via its analytics_processed_events table). A message
that is not a valid CloudEvent is dead-lettered (repromise consumer)
or logged at WARN and skipped (local-cache consumers, projector).
apart from additive optional members; additive for OrderRepromised)
OrderAllocated, OrderPartiallyAllocated, and — since ADR 0014 §5 /
ADR 0018 — OrderRepromised are published to
warehouse.order-management.events — mirroring
inventory-storage's precedent of forwarding a minimal subset of domain
events cross-context. The data.lines[] entry shape on the first two
is shared verbatim with wes-work-planning's Kafka consumer and MUST
NOT change without coordinating both sides. fulfillment_class is
additive (ADR 0008); the top-level site_id is additive (ADR 0050,
omitempty — absent for an order without a caller-assigned site).
OrderRepromised is the fleet's "your delivery is
delayed" trigger, raised by the new RepromiseOrder consumer
(ADR 0018) reacting to fulfillment-execution's TaskCPTMissed/
PackageManifested on warehouse.fulfillment.events.
Production Kafka cluster shared by every warehouse-systems bounded context. Locally, the fleet's single broker runs inside the kind cluster and is reachable from the host at localhost:9092 (the repo-local docker-compose broker was retired).
The outbound integration topic owned by the Order Management bounded context (kafka.Topic in the code). OrderAllocated/ OrderPartiallyAllocated and — since ADR 0018 — OrderRepromised are forwarded here; since ADR 0035 the additive, PII-free SiteSkuDemandChanged projection is too (keyed by the line-scoped <order_id>/line/<line_no>, not the bare order id). Every other domain event is a local concern. wes-work-planning's Kafka consumer derives each line's work unit id from the frozen formula {orderID}-line-{lineNo}.
Consume order allocation-outcome, re-promise, and site/SKU demand integration events.
Subscribe to this channel to learn that an order's allocation-then-release pass concluded, that its promise moved, or that one source order line's site/SKU demand changed. OrderAllocated means every line was allocated (and every eligible line released in the same pass); OrderPartiallyAllocated means some lines allocated and some backordered on a partial-shipment order. OrderRepromised (ADR 0018) means the promise for a shipment group moved, discovered by reacting to a fulfillment-execution fact (a missed CPT or a SLAM pass) — the fleet's "your delivery is delayed" trigger. data.lines[] on the first two carries exactly the lines released in this pass. SiteSkuDemandChanged (ADR 0035) is keyed by <source_order_id>/line/<line_no> so one line's demand stream is ordered on its own partition; it is emitted for an order that carries a caller-assigned fulfillment site (order-site-v1, ADR 0044) or, for one that does not, while DEMAND_PROJECTION_SITE_ID is configured (static-site-v1), and state is ACTIVE (line demand exists at the site) or REMOVED (cancellation removed it). Consumers must be idempotent (dedupe on id) and should ignore CloudEvents type values they do not recognise.
Available only on servers:
Accepts one of the following messages:
Every line allocated — and eligible lines released in the same pass.
The whole order is allocated and, per the choreographed-release redesign (ADR 0005), every eligible line was released as part of this same fact. data.lines[] carries the released lines; each line's work unit id is derived, never transmitted, as {order_id}-line-{line_no}.
A two-line ship-complete order allocated and released.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderAllocated",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:01:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:OrderAllocated:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"promise_date": "2026-09-09T10:01:00Z",
"lines": [
{
"line_no": 1,
"sku": "SKU-BOOK-0001",
"path_id": "pick",
"gift_wrap": false,
"fulfillment_class": "SAME_SKU_MULTI"
},
{
"line_no": 2,
"sku": "SKU-BOOK-0002",
"path_id": "pick",
"gift_wrap": true,
"fulfillment_class": "SAME_SKU_MULTI"
}
]
}
}
ADR 0050 — same allocation at a caller-assigned site (site_id present).
{
"specversion": "1.0",
"id": "5e2d8b9f-0c48-4d7a-9e1b-7f3a6c8d9e01",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderAllocated",
"subject": "ord-8d0f7791-6e8b-4c28-a3d7-04c1b5e2f9a3",
"time": "2026-11-05T10:01:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:OrderAllocated:v1",
"data": {
"order_id": "ord-8d0f7791-6e8b-4c28-a3d7-04c1b5e2f9a3",
"promise_date": "2026-11-07T10:01:00Z",
"site_id": "WH2",
"lines": [
{
"line_no": 1,
"sku": "SKU-TOY-0042",
"path_id": "pick",
"gift_wrap": false,
"fulfillment_class": "SINGLE"
}
]
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
Some lines allocated, some backordered, on a partial-shipment order.
An order with AllowPartialShipment=true concluded its pass with some lines allocated (and released in this same pass — data.lines[] carries exactly those) and some lines Backordered. A ship-complete order NEVER emits this event: under BR3 its whole status stays Backordered until RetryAllocation succeeds.
One line released, one line backordered.
{
"specversion": "1.0",
"id": "8a3d6c11-52b7-4f0d-9c14-3e7a5b8d2f46",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderPartiallyAllocated",
"subject": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"time": "2026-09-07T10:02:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:OrderPartiallyAllocated:v1",
"data": {
"order_id": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"promise_date": "2026-09-09T10:02:00Z",
"lines": [
{
"line_no": 1,
"sku": "SKU-TOY-0042",
"path_id": "pick",
"gift_wrap": false,
"fulfillment_class": "MULTI_LINE_MULTI"
}
]
}
}
ADR 0050 — same partial pass at a caller-assigned site (site_id present).
{
"specversion": "1.0",
"id": "9b4e7c22-63a8-5e1d-8f25-4a6b7c8d9e12",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderPartiallyAllocated",
"subject": "ord-2c3a4f5b-8d90-4e67-8a1c-9d0e1f2a3b4c",
"time": "2026-11-05T10:02:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:OrderPartiallyAllocated:v1",
"data": {
"order_id": "ord-2c3a4f5b-8d90-4e67-8a1c-9d0e1f2a3b4c",
"promise_date": "2026-11-07T10:02:00Z",
"site_id": "DC7",
"lines": [
{
"line_no": 1,
"sku": "SKU-BOOK-0001",
"path_id": "pick",
"gift_wrap": false,
"fulfillment_class": "MULTI_LINE_MULTI"
}
]
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
The promise for a shipment group moved — the fleet's "your delivery is delayed" trigger (ADR 0014 §5 / ADR 0018).
Raised by the RepromiseOrder use case when reacting to fulfillment-execution's TaskCPTMissed (a task still open past its CPT) or PackageManifested (a SLAM pass) reveals that the affected PromiseGroup's fresh recompute differs from its current promise. cpt_id_old/cpt_id_new are both absent (omitempty) for a LeadTime-basis promise on that side — a LeadTime-basis promise has no CPT departure identity, only a computed cutoff instant. This event does not itself contact a customer: it is the trigger, not the notification.
A missed CPT pushed the promise to a later cutoff.
{
"specversion": "1.0",
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderRepromised",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-14T12:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:OrderRepromised:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"cpt_id_old": "sp1-1200",
"cpt_id_new": "sp1-1800",
"reason": "TaskCPTMissed"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
One source order line's site/SKU demand became ACTIVE or REMOVED — the PII-free demand projection for site-level planning (ADR 0035).
Raised inside the same order-save/outbox transaction as the allocation, re-allocation, re-promise, or cancellation that produced the line state, derived purely from the Order aggregate's line (SKU, quantity) plus a site resolved under one of TWO explicitly versioned regimes, told apart by assignment_version (ADR 0044 amending ADR 0035): order-site-v1 — the order carries a fulfillment site ASSIGNED BY ITS CALLER at intake (customer-ordering or network-fulfillment; never inferred here), and that site wins, even when no static site is configured; static-site-v1 — the order carries none, so the deployment's static demand-site scope (DEMAND_PROJECTION_SITE_ID) applies, exactly as before. With neither, no event is emitted. This service performs no sourcing: it carries the caller's site and nothing more. subject and the Kafka key are <source_order_id>/line/<line_no> — the LINE is the stream identity here, so one line's demand history is totally ordered on its own partition (deliberately not the bare order id every Order* event uses). due_at is the line's own promise-group cutoff (ADR 0017) where one is recorded, else the order-level promise date. demanded_units is the line quantity; state is ACTIVE (create / allocate / re-promise) or REMOVED (cancellation). No customer PII ever appears on this event.
A line's demand becomes ACTIVE at the site its caller assigned on the order (order-site-v1).
{
"specversion": "1.0",
"id": "9e4f1a3b-5c6d-4e7f-8a0b-2c3d4e5f6a7b",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChanged",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2/line/1",
"time": "2026-10-06T12:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:SiteSkuDemandChanged:v1",
"data": {
"source_order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 1,
"site_id": "WH2",
"sku": "SKU-TOY-0042",
"demanded_units": 4,
"due_at": "2026-10-08T18:00:00Z",
"state": "ACTIVE",
"assignment_version": "order-site-v1"
}
}
A line's demand becomes ACTIVE at the configured static site (the order carries no site).
{
"specversion": "1.0",
"id": "7c2d9e1f-3a4b-4c5d-8e9f-0a1b2c3d4e5f",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChanged",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2/line/3",
"time": "2026-10-06T12:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:SiteSkuDemandChanged:v1",
"data": {
"source_order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 3,
"site_id": "SIM1",
"sku": "SKU-TOY-0042",
"demanded_units": 7,
"due_at": "2026-10-08T18:00:00Z",
"state": "ACTIVE",
"assignment_version": "static-site-v1"
}
}
Cancellation removes a line's demand at the site.
{
"specversion": "1.0",
"id": "8d3e0f2a-4b5c-4d6e-9f0a-1b2c3d4e5f6a",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChanged",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2/line/3",
"time": "2026-10-06T15:30:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:events:SiteSkuDemandChanged:v1",
"data": {
"source_order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 3,
"site_id": "SIM1",
"sku": "SKU-TOY-0042",
"demanded_units": 7,
"due_at": "2026-10-08T18:00:00Z",
"state": "REMOVED",
"assignment_version": "static-site-v1"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
fulfillment-execution's shared/fan-out integration topic — the SAME one labor-performance already consumes for TaskCompleted. This context consumes it ONLY for TaskCPTMissed/PackageManifested (ADR 0018, reacting to fulfillment-execution's own ADR 0025); every other event type on this topic is silently skipped. order-management does not import fulfillment-execution's Go code — this channel's messages below are this context's own independently-declared copy of that service's real, shipped wire shape.
React to a missed CPT or a SLAM pass to re-promise the affected order.
order_ref on both message types is shaped like this context's own WorkUnitID formula ({orderId}-line-{lineNo}) — NOT a bare OrderId — because fulfillment-execution populates it from wes-work-planning's WorkUnitId, itself derived from this context's formula at release time. The RepromiseOrder consumer parses it back apart via usecases.ParseWorkUnitID.
Available only on servers:
Accepts one of the following messages:
A fulfillment-execution task is still open past its CPT.
Consumed from warehouse.fulfillment.events (ADR 0018). Re-fires on every sweep pass fulfillment-execution runs, for as long as the task stays overdue (that service's own ADR 0025 §4) — this context's own CloudEvents-id-keyed idempotency gate is what makes that safe to consume. order_ref is a WorkUnitId-shaped reference ({orderId}-line-{lineNo}), not a bare OrderId.
A PICK task for order line 2 is still open past its CPT.
{
"specversion": "1.0",
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"source": "/warehouse/fulfillment-execution",
"type": "com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed",
"subject": "task-42",
"time": "2026-09-14T11:59:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:fulfillment-execution:events:TaskCPTMissed:v1",
"data": {
"task_id": "task-42",
"order_ref": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-2",
"task_type": "PICK",
"cpt": "2026-09-14T11:55:00Z"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A package passed SLAM (weigh-check succeeded).
Consumed from warehouse.fulfillment.events (ADR 0018). Raised alongside LabelApplied on fulfillment-execution's own outbox (its ADR 0025 §5). order_ref is a WorkUnitId-shaped reference, not a bare OrderId.
A package for order line 1 passed SLAM.
{
"specversion": "1.0",
"id": "3c4d5e6f-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
"source": "/warehouse/fulfillment-execution",
"type": "com.warehouse.wes.fulfillment-execution.package.PackageManifested",
"subject": "pkg-99",
"time": "2026-09-14T12:01:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:fulfillment-execution:events:PackageManifested:v1",
"data": {
"package_id": "pkg-99",
"order_ref": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-1"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
outbound-shipping's integration topic (its merged apis/asyncapi.yaml, the producer contract ADR 0051 pins). This context consumes it ONLY for ShipmentConfirmed (the fleet's "this actually shipped" fact: the named orders' Released lines become Shipped) and PackageMissedLoad (a package not loaded by its cutoff: the named order is re-promised order-wide through the ADR 0018 machinery). Every other event type on this topic is silently skipped. outbound-shipping's Go code is never imported — the messages below are this context's own independently-declared copies of that service's real wire shapes.
Ship confirmed orders; re-promise orders whose package missed its load.
Dispatch is on the FULL CloudEvents type. The CloudEvents id is the idempotency key: one ShipmentConfirmed claims its id once for EVERY order it names (shipment_processed_events), and PackageMissedLoad claims through the repromise gate. A ShipmentConfirmed naming an order this context does not know, or an order with no Released line, is skipped-and-logged and committed past — never a dead letter (ADR 0051); only a non-CloudEvents message or an undecodable payload is dead-lettered to ".dlq". Runs under a STABLE shared consumer group (env OUTBOUND_SHIPPING_CONSUMER_GROUP; the consumer itself ships dark behind OUTBOUND_SHIPPING_CONSUMER_MODE=off|kafka).
Available only on servers:
Accepts one of the following messages:
A closed load physically left the site on a trailer.
Consumed from warehouse.outbound-shipping.events (ADR 0051). The orders[] entries carry the DISTINCT source_order_id of the shipped packages (a bare OrderId — the producer strips any -line-N suffix); a package manifested without one is excluded by the producer. Only load_id and orders[].order_id are read; every other member (site_id, cpt_id, carrier, trailer_id, seal_number, departed_at, version) is ignored by the fixed decode struct. One event ships every named order's Released lines atomically.
A load carrying two orders departed the site.
{
"specversion": "1.0",
"id": "45e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80",
"source": "/warehouse/outbound-shipping",
"type": "com.warehouse.wms.outbound-shipping.outboundload.ShipmentConfirmed",
"subject": "load-42",
"time": "2026-11-06T17:05:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:outbound-shipping:events:ShipmentConfirmed:v1",
"data": {
"load_id": "load-42",
"site_id": "SITE1",
"cpt_id": "sp1-1800",
"carrier": "CARRIER-X",
"trailer_id": "trailer-9",
"seal_number": "seal-4",
"departed_at": "2026-11-06T17:05:00Z",
"orders": [
{
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2"
},
{
"order_id": "ord-0d1e2f3a-4b5c-6d7e-8f9a-0b1c2d3e4f5a"
}
],
"version": 3
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A package was not loaded by its cutoff.
Consumed from warehouse.outbound-shipping.events (ADR 0051). source_order_id is a BARE OrderId (not the WorkUnitId shape fulfillment-execution's events carry), so this event drives the ORDER-WIDE re-promise (RepromiseOrder.ExecuteForMissedLoad), not the per-line one. cutoff is decoded for logging only; the fresh promise comes from current inputs. A payload without source_order_id is skipped-and-logged (nothing to join on).
A package for one order missed its load's cutoff.
{
"specversion": "1.0",
"id": "56f7a8b9-c0d1-4e2f-9a3b-4c5d6e7f8a90",
"source": "/warehouse/outbound-shipping",
"type": "com.warehouse.wms.outbound-shipping.shippingpackage.PackageMissedLoad",
"subject": "pkg-101",
"time": "2026-11-06T16:05:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:outbound-shipping:events:PackageMissedLoad:v1",
"data": {
"package_id": "pkg-101",
"load_id": "load-42",
"site_id": "SITE1",
"source_order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"cutoff": "2026-11-06T16:00:00Z",
"detected_at": "2026-11-06T16:05:00Z",
"version": 2
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
process-path-management's integration topic. Replayed from FirstOffset under per-process-unique consumer groups by two local caches: the process-path catalogue (ProcessPath*) and the CPT schedule cache (CPTScheduleChanged). Every other CloudEvents type is ignored; a non-CloudEvents message is logged at WARN and skipped.
Maintain the local process-path catalogue and CPT schedule caches.
Dispatch is on the FULL CloudEvents type: com.warehouse.wes.process-path-management.processpath.ProcessPathCreated/Updated/Deactivated feed the catalogue (ADR 0013/0016), and com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged feeds the CPT schedule cache (ADR 0014). Each event is a last-write-wins snapshot, so re-applying one is idempotent.
Available only on servers:
Accepts one of the following messages:
A process path was defined.
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "string",
"match_prefix": "string",
"cycle_time_p95": "string",
"eligibility": {
"max_units_per_line": 0,
"required_product_attributes": [
"string"
],
"excluded_product_attributes": [
"string"
],
"non_sortable": true
},
"destination_location_role": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A process path definition changed.
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathUpdated:v1",
"data": {
"path_id": "string",
"match_prefix": "string",
"cycle_time_p95": "string",
"eligibility": {
"max_units_per_line": 0,
"required_product_attributes": [
"string"
],
"excluded_product_attributes": [
"string"
],
"non_sortable": true
},
"destination_location_role": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A process path was deactivated.
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathDeactivated:v1",
"data": {
"path_id": "string",
"match_prefix": "string",
"cycle_time_p95": "string",
"eligibility": {
"max_units_per_line": 0,
"required_product_attributes": [
"string"
],
"excluded_product_attributes": [
"string"
],
"non_sortable": true
},
"destination_location_role": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A site's full CPT schedule snapshot.
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:CPTScheduleChanged:v1",
"data": {
"site_id": "string",
"timezone": "string",
"cutoffs": [
{
"cpt_id": "string",
"local_time": "string",
"days_of_week": [
"string"
],
"ship_method": "string",
"eligible_path_ids": [
"string"
]
}
]
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
wes-work-planning's integration topic, read by TWO independent consumers, each acting on one FULL CloudEvents type and ignoring every other. (1) The path-capacity local cache (ADR 0015), replayed from FirstOffset, acts only on PathCapacityChanged. (2) The release-confirmation consumer (ADR 0043), under a STABLE shared consumer group (env RELEASE_CONFIRMATION_CONSUMER_GROUP, ships dark behind RELEASE_CONFIRMATION_MODE=off|kafka), acts only on WorkUnitCreated; a message that is not a valid CloudEvent, or whose data cannot be decoded, is dead-lettered to warehouse.work-planning.events.dlq and committed past. A non-CloudEvents message is logged at WARN and skipped by the cache.
Maintain the local remaining-capacity cache; confirm released order lines.
PathCapacityChanged is a last-write-wins observation keyed by (path_id, cutoff_at). WorkUnitCreated confirms the order line named by its OPTIONAL reference (the order id) and line_no fields: the matching PENDING or UNCONFIRMED row of the release_confirmations process manager becomes CONFIRMED, in one database transaction with the idempotency claim on the CloudEvents id. An event without both fields, or naming a line this service never released (transfer, RELOCATE and legacy work share this event), is IGNORED and counted (order.release_confirmation.events), never dead-lettered. These contracts are wes-work-planning's own, decoded independently here, never imported.
Available only on servers:
Accepts one of the following messages:
Remaining capacity for a path at an exact cutoff instant (ADR 0015).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/wes-work-planning",
"type": "com.warehouse.wes.work-planning.workpool.PathCapacityChanged",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:wes-work-planning:events:PathCapacityChanged:v1",
"data": {
"path_id": "string",
"cutoff_at": "2019-08-24T14:15:22Z",
"remaining_units": 0,
"known": true
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
wes-work-planning admitted a unit of work; confirms an order-line release (ADR 0043).
The enqueue confirmation. Since wes-work-planning's ADR 0041 its integration-stream data carries two OPTIONAL fields beside the existing path_id and work_unit_id: reference (the work unit's originating reference; for order work, the order id) and line_no (integer > 0; omitted when unknown). The CloudEvents type, subject (the work unit id) and dataschema v1 are unchanged. Only reference and line_no are read.
Line 2 of an order was enqueued as a work unit.
{
"specversion": "1.0",
"id": "11111111-1111-4111-8111-111111111111",
"source": "/warehouse/wes-work-planning",
"type": "com.warehouse.wes.work-planning.workunit.WorkUnitCreated",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-2",
"time": "2026-09-07T10:01:35Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:wes-work-planning:events:WorkUnitCreated:v1",
"data": {
"path_id": "pick",
"work_unit_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-2",
"reference": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 2
}
}
Transfer, RELOCATE or legacy work, or a producer that predates the fields — ignored and counted.
{
"specversion": "1.0",
"id": "22222222-2222-4222-8222-222222222222",
"source": "/warehouse/wes-work-planning",
"type": "com.warehouse.wes.work-planning.workunit.WorkUnitCreated",
"subject": "wu-gold",
"time": "2026-09-07T10:02:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:wes-work-planning:events:WorkUnitCreated:v1",
"data": {
"path_id": "pick",
"work_unit_id": "wu-gold"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
warehouse-planning's integration topic (key and CloudEvents subject = the capacity plan id). Consumed under a STABLE shared consumer group (env PLANNED_CAPACITY_CONSUMER_GROUP, ADR 0031) — a normal process-and-commit consumer, not a full-replay cache. Every other CloudEvents type is ignored; a message that is not a valid CloudEvent, or whose payload cannot be applied, is dead-lettered to warehouse.warehouse-planning.events.dlq and committed past.
Maintain the local planned-capacity read model.
Dispatch is on the FULL CloudEvents type. CapacityPlanCreated stores a DRAFT row; CapacityPlanPublished and CapacityShortageDetected store a PUBLISHED row; CapacityPlanSuperseded moves the older plan's row to a terminal SUPERSEDED status that never influences an order, or inserts a SUPERSEDED tombstone for a plan never seen (ADR 0052); BottleneckDetected is recognised and ignored (its bottleneck_step is already carried by CapacityShortageDetected). The row is keyed by plan id with last-writer-wins on the CloudEvents time (a DRAFT never replaces a PUBLISHED row; nothing replaces a SUPERSEDED row, and SUPERSEDED replaces any other status regardless of time). The idempotency claim on the CloudEvents id and the upsert commit in ONE database transaction; the Kafka offset is committed only afterwards. Only a PUBLISHED plan with shortage > 0 ever influences an order (ADR 0031). These contracts are warehouse-planning's own — see its apis/asyncapi.yaml — decoded independently here, never imported.
Available only on servers:
Accepts one of the following messages:
A DRAFT capacity plan exists (stored as DRAFT; never influences an order).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.capacityplan.CapacityPlanCreated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:CapacityPlanCreated:v1",
"data": {
"plan_id": "string",
"warehouse_id": "string",
"location": "string",
"path_id": "string",
"window_start": "2019-08-24T14:15:22Z",
"window_end": "2019-08-24T14:15:22Z",
"assigned_demand": 0.1,
"capacity_over_window": 0.1,
"shortage": 0,
"bottleneck_step": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A capacity plan was published (stored as PUBLISHED).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.capacityplan.CapacityPlanPublished",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:CapacityPlanPublished:v1",
"data": {
"plan_id": "string",
"warehouse_id": "string",
"location": "string",
"path_id": "string",
"window_start": "2019-08-24T14:15:22Z",
"window_end": "2019-08-24T14:15:22Z",
"assigned_demand": 0.1,
"capacity_over_window": 0.1,
"shortage": 0,
"bottleneck_step": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A published plan's demand exceeds its capacity over the window (stored as PUBLISHED with its shortage).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.capacityplan.CapacityShortageDetected",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:CapacityShortageDetected:v1",
"data": {
"plan_id": "string",
"warehouse_id": "string",
"location": "string",
"path_id": "string",
"window_start": "2019-08-24T14:15:22Z",
"window_end": "2019-08-24T14:15:22Z",
"assigned_demand": 0.1,
"capacity_over_window": 0.1,
"shortage": 0,
"bottleneck_step": "string"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
The path step limiting a plan with a shortage (recognised and ignored: CapacityShortageDetected carries bottleneck_step).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.capacityplan.BottleneckDetected",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:BottleneckDetected:v1",
"data": {
"plan_id": "string",
"bottleneck_step": "string",
"path_capacity": 0.1
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A newer plan of the same window replaced this one (stored as a terminal SUPERSEDED row that never influences an order; ADR 0052).
{
"specversion": "1.0",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.capacityplan.CapacityPlanSuperseded",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:CapacityPlanSuperseded:v1",
"data": {
"plan_id": "string",
"superseded_by": "string",
"site_id": "string",
"location": "string",
"path_id": "string",
"window_start": "2019-08-24T14:15:22Z",
"window_end": "2019-08-24T14:15:22Z"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
product-master's integration topic (key and CloudEvents subject = the SKU). Consumed under a STABLE shared consumer group (env PRODUCT_CLASSIFICATION_CONSUMER_GROUP, ADR 0036) when PRODUCT_CLASSIFICATION_MODE=kafka — a normal process-and-commit consumer feeding a durable local copy, not a full-replay cache. Only ProductClassified is applied; every other CloudEvents type on the topic (ProductRegistered, ProductDescriptionChanged, ProductDimensionsDeclared, ProductMeasured, anything new) is ignored. A message that is not a valid CloudEvent, or whose payload cannot be applied, is logged at WARN and committed past (no DLQ: the payload is a full-state replacement).
Maintain the local product-classification copy read at order intake.
Dispatch is on the FULL CloudEvents type com.warehouse.wms.product-master.product.ProductClassified. The copy keeps one row per SKU with the classification and product-master's aggregate version; a message is applied only when its version is greater than the stored one (inserted when absent). The idempotency claim on the CloudEvents id and the upsert commit in ONE database transaction; the Kafka offset is committed only afterwards, and a transient failure is retried on the same message. ReceiveOrder reads the copy through ports.ProductClassificationLookup to evaluate path eligibility (ADR 0016); an unknown SKU stays "no derived attributes" (fail-open). This contract is product-master's own — see its apis/asyncapi.yaml — decoded independently here, never imported.
Available only on servers:
Accepts the following message:
A product's handling classification was set or replaced (full state; applied when version > stored).
Consumed from warehouse.product-master.events (ADR 0036). Subject and Kafka key = the SKU. Full-state replacement of the classification; temperature_class and dot_hazard_class are omitted when unset. Tags come in product-master's stable order (Hazmat, Fragile, TemperatureSensitive, Oversized, HighValue). There is no "unclassify" event in v1.
SKU-1 classified Hazmat + TemperatureSensitive (Frozen), DOT class 3.
{
"specversion": "1.0",
"id": "0f6d8a2b-3c4e-4d5f-8a9b-7c6d5e4f3a2b",
"source": "/warehouse/product-master",
"type": "com.warehouse.wms.product-master.product.ProductClassified",
"subject": "SKU-1",
"time": "2026-10-06T21:02:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:product-master:events:ProductClassified:v1",
"data": {
"sku": "SKU-1",
"handling_tags": [
"Hazmat",
"TemperatureSensitive"
],
"temperature_class": "Frozen",
"dot_hazard_class": 3,
"classification_source": "native",
"version": 3
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
The analytics fan-out topic (kafka.AnalyticsTopic in the code), separate from the integration topic so the OLTP integration contract and the analytical read-model stream evolve independently (ADR 0006). order-management publishes every analytics-relevant domain event here; cmd/order-projector is the sole consumer and the only writer of the analytical store.
Fan out order domain events for the analytics data product.
order-management publishes each domain event (enriched with its process path via an OrderRepo lookup) as a CloudEvents 1.0 event whose dataschema is urn:warehouse:order-management:analytics::v1. Unrecognised event types are skipped by the publisher, so this channel only ever carries the eleven types listed under subscribe below. Since ADR 0019, OrderAllocated/ OrderPartiallyAllocated additionally carry promise_basis/ promise_cutoff_at/split_shipment (ADR 0014 §6's promise KPIs), and OrderRepromised (ADR 0018) is published here too, deliberately WITHOUT a path_id — see OrderRepromisedAnalytics below.
Available only on servers:
Accepts the following message:
The analytics fan-out topic (kafka.AnalyticsTopic in the code), separate from the integration topic so the OLTP integration contract and the analytical read-model stream evolve independently (ADR 0006). order-management publishes every analytics-relevant domain event here; cmd/order-projector is the sole consumer and the only writer of the analytical store.
Project order events into the analytical store.
cmd/order-projector consumes this topic from FirstOffset and is the ONLY writer of the analytical Postgres. It is idempotent on the CloudEvents id; a redelivery is always a no-op. The report keyed per path x hour (Order Funnel & Allocation Health) reads what this projection writes; since ADR 0019 it also derives promise basis distribution, re-promise rate, split-shipment rate, and promise-to-cutoff gap from this same stream.
Available only on servers:
Accepts one of the following messages:
An order was accepted into the building with its lines.
The funnel's top stage. Published unconditionally at intake, before allocation is ever attempted.
A two-line order was received on the pick path.
{
"specversion": "1.0",
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderReceived",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderReceived:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"path_id": "pick",
"line_count": 2
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
inventory-storage accepted a reservation for a line.
Reservation state stays owned by inventory-storage; this fact carries only the line's identifying details for the funnel.
Line 1 of an order was allocated.
{
"specversion": "1.0",
"id": "d2e3f4a5-6b7c-4d8e-9f0a-1b2c3d4e5f6a",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderLineAllocated",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:00:30Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderLineAllocated:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 1,
"path_id": "pick",
"sku": "SKU-BOOK-0001"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
inventory-storage reported insufficient usable stock (HTTP 409).
Funnel leakage. A BUSINESS FACT only — never produced from a transport or 5xx failure (those fail the call outright instead).
Line 2 was backordered.
{
"specversion": "1.0",
"id": "e3f4a5b6-7c8d-4e9f-0a1b-2c3d4e5f6a7b",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderLineBackordered",
"subject": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"time": "2026-09-07T10:00:31Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderLineBackordered:v1",
"data": {
"order_id": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"line_no": 2,
"path_id": "pick",
"sku": "SKU-TOY-9999"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
Every line on the order is allocated (and released).
The funnel's allocated stage; the path dimension comes from the first released line (or an OrderRepo lookup when none were released).
An order concluded its pass fully allocated on pick.
{
"specversion": "1.0",
"id": "f4a5b6c7-8d9e-4f0a-1b2c-3d4e5f6a7b8c",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderAllocated",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:01:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderAllocated:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"path_id": "pick"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
Some lines allocated, some backordered.
Carries the allocated/backordered split for allocation-health reporting on partial-shipment orders.
One line allocated, one backordered.
{
"specversion": "1.0",
"id": "a5b6c7d8-9e0f-4a1b-2c3d-4e5f6a7b8c9d",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderPartiallyAllocated",
"subject": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"time": "2026-09-07T10:02:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderPartiallyAllocated:v1",
"data": {
"order_id": "ord-1b2f1e0a-5f4f-4a67-9c1e-6e2f3a4b5c6d",
"path_id": "pick",
"allocated_lines": 1,
"backordered_lines": 1
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A hard failure hit mid-allocation; some lines genuinely allocated.
Fail-closed visibility (ADR 0003): the already-succeeded reservations are kept, remaining lines stay Pending, and this fact makes the outcome observable rather than silent.
One line allocated before inventory-storage became unreachable.
{
"specversion": "1.0",
"id": "b6c7d8e9-0f1a-4b2c-3d4e-5f6a7b8c9d0e",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderAllocationPartiallyFailed",
"subject": "ord-3c4d5e6f-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
"time": "2026-09-07T10:03:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderAllocationPartiallyFailed:v1",
"data": {
"order_id": "ord-3c4d5e6f-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
"path_id": "pick",
"allocated_lines": 1,
"remaining_lines": 1
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A line's work was announced as released to wes-work-planning.
Since ADR 0005 release is choreographed — there is no synchronous call — so this fact is announced per line, carrying the path the line was released onto and the deterministic work unit id.
Line 1 released onto the pick path.
{
"specversion": "1.0",
"id": "c7d8e9f0-1a2b-4c3d-4e5f-6a7b8c9d0e1f",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderLineReleased",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:01:30Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderLineReleased:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 1,
"path_id": "pick",
"work_unit_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-1"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
Every line on the order has been released as work.
The funnel's bottom stage.
The order fully released on the pick path.
{
"specversion": "1.0",
"id": "d8e9f0a1-2b3c-4d4e-5f6a-7b8c9d0e1f2a",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderReleased",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:01:31Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderReleased:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"path_id": "pick"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
The order was cancelled before any line was released.
Funnel leakage at the cancellation boundary (BR6): legal only while no line has reached Released. Revoked reservations were returned to inventory-storage.
A pre-release order was cancelled, revoking one reservation.
{
"specversion": "1.0",
"id": "e9f0a1b2-3c4d-4e5f-6a7b-8c9d0e1f2a3b",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderCancelled",
"subject": "ord-4d5e6f7a-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
"time": "2026-09-07T10:04:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderCancelled:v1",
"data": {
"order_id": "ord-4d5e6f7a-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
"path_id": "pick",
"revoked_reservations": 1
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
The promise for a shipment group moved — the re-promise-rate KPI's source fact (ADR 0014 §6 / ADR 0019).
Published on the analytics topic since ADR 0019, closing a gap left when ADR 0018 shipped the RepromiseOrder consumer: this event was raised on the integration topic (warehouse.order-management.events) but never reached the analytics publisher's marshalData switch. Deliberately carries NO path_id, unlike every other analytics message on this channel — OrderRepromised itself has no process-path dimension in its domain event, and this data product tracks the re-promise-rate KPI fleet-wide rather than adding an OrderRepo lookup for a dimension nothing asked for (see ADR 0019's Decision §2 for the full reasoning). Unlike the integration-topic message, cpt_id_old/cpt_id_new are ALWAYS present on the analytics payload (no omitempty): the empty string for a LeadTime-basis promise on that side.
A missed CPT pushed the promise to a later cutoff.
{
"specversion": "1.0",
"id": "4b5c6d7e-8f9a-4b0c-1d2e-3f4a5b6c7d8e",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderRepromised",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-14T12:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderRepromised:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"cpt_id_old": "sp1-1200",
"cpt_id_new": "sp1-1800",
"reason": "TaskCPTMissed"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
A released line was never confirmed by wes-work-planning within the timeout.
ADR 0043. Raised ONCE per line, by the housekeeping sweep, when a PENDING release confirmation is older than RELEASE_CONFIRMATION_TIMEOUT (default 15m) without a WorkUnitCreated naming it. A FACT, never an action: nothing is cancelled, re-released or retried because of it, and it is not retracted if a late confirmation arrives. Analytics-only — the integration topic warehouse.order-management.events keeps its four-event contract (OrderAllocated, OrderPartiallyAllocated, OrderRepromised, SiteSkuDemandChanged) — and the in-repo projector ignores the type. subject and the Kafka key are the order id; time is when the line was flagged, released_at when it was released.
Line 2 was released at 10:01:30 and never confirmed; flagged 15 minutes later.
{
"specversion": "1.0",
"id": "0b9d1e44-3c52-4f7a-9a60-5d8e2f1c7b33",
"source": "/warehouse/order-management",
"type": "com.warehouse.wes.order-management.order.OrderReleaseUnconfirmed",
"subject": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"time": "2026-09-07T10:17:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:order-management:analytics:OrderReleaseUnconfirmed:v1",
"data": {
"order_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2",
"line_no": 2,
"path_id": "pick",
"work_unit_id": "ord-7c9e6679-7d5a-4b37-b2f1-93b0c4a1d8f2-line-2",
"released_at": "2026-09-07T10:01:30Z"
}
}
{
"content-type": "application/cloudevents+json; charset=UTF-8",
"traceparent": "string",
"tracestate": "string"
}
Every line allocated — and eligible lines released in the same pass.
The whole order is allocated and, per the choreographed-release redesign (ADR 0005), every eligible line was released as part of this same fact. data.lines[] carries the released lines; each line's work unit id is derived, never transmitted, as {order_id}-line-{line_no}.
Some lines allocated, some backordered, on a partial-shipment order.
An order with AllowPartialShipment=true concluded its pass with some lines allocated (and released in this same pass — data.lines[] carries exactly those) and some lines Backordered. A ship-complete order NEVER emits this event: under BR3 its whole status stays Backordered until RetryAllocation succeeds.
The promise for a shipment group moved — the fleet's "your delivery is delayed" trigger (ADR 0014 §5 / ADR 0018).
Raised by the RepromiseOrder use case when reacting to fulfillment-execution's TaskCPTMissed (a task still open past its CPT) or PackageManifested (a SLAM pass) reveals that the affected PromiseGroup's fresh recompute differs from its current promise. cpt_id_old/cpt_id_new are both absent (omitempty) for a LeadTime-basis promise on that side — a LeadTime-basis promise has no CPT departure identity, only a computed cutoff instant. This event does not itself contact a customer: it is the trigger, not the notification.
One source order line's site/SKU demand became ACTIVE or REMOVED — the PII-free demand projection for site-level planning (ADR 0035).
Raised inside the same order-save/outbox transaction as the allocation, re-allocation, re-promise, or cancellation that produced the line state, derived purely from the Order aggregate's line (SKU, quantity) plus a site resolved under one of TWO explicitly versioned regimes, told apart by assignment_version (ADR 0044 amending ADR 0035): order-site-v1 — the order carries a fulfillment site ASSIGNED BY ITS CALLER at intake (customer-ordering or network-fulfillment; never inferred here), and that site wins, even when no static site is configured; static-site-v1 — the order carries none, so the deployment's static demand-site scope (DEMAND_PROJECTION_SITE_ID) applies, exactly as before. With neither, no event is emitted. This service performs no sourcing: it carries the caller's site and nothing more. subject and the Kafka key are <source_order_id>/line/<line_no> — the LINE is the stream identity here, so one line's demand history is totally ordered on its own partition (deliberately not the bare order id every Order* event uses). due_at is the line's own promise-group cutoff (ADR 0017) where one is recorded, else the order-level promise date. demanded_units is the line quantity; state is ACTIVE (create / allocate / re-promise) or REMOVED (cancellation). No customer PII ever appears on this event.
A fulfillment-execution task is still open past its CPT.
Consumed from warehouse.fulfillment.events (ADR 0018). Re-fires on every sweep pass fulfillment-execution runs, for as long as the task stays overdue (that service's own ADR 0025 §4) — this context's own CloudEvents-id-keyed idempotency gate is what makes that safe to consume. order_ref is a WorkUnitId-shaped reference ({orderId}-line-{lineNo}), not a bare OrderId.
A package passed SLAM (weigh-check succeeded).
Consumed from warehouse.fulfillment.events (ADR 0018). Raised alongside LabelApplied on fulfillment-execution's own outbox (its ADR 0025 §5). order_ref is a WorkUnitId-shaped reference, not a bare OrderId.
A closed load physically left the site on a trailer.
Consumed from warehouse.outbound-shipping.events (ADR 0051). The orders[] entries carry the DISTINCT source_order_id of the shipped packages (a bare OrderId — the producer strips any -line-N suffix); a package manifested without one is excluded by the producer. Only load_id and orders[].order_id are read; every other member (site_id, cpt_id, carrier, trailer_id, seal_number, departed_at, version) is ignored by the fixed decode struct. One event ships every named order's Released lines atomically.
A package was not loaded by its cutoff.
Consumed from warehouse.outbound-shipping.events (ADR 0051). source_order_id is a BARE OrderId (not the WorkUnitId shape fulfillment-execution's events carry), so this event drives the ORDER-WIDE re-promise (RepromiseOrder.ExecuteForMissedLoad), not the per-line one. cutoff is decoded for logging only; the fresh promise comes from current inputs. A payload without source_order_id is skipped-and-logged (nothing to join on).
An order was accepted into the building with its lines.
The funnel's top stage. Published unconditionally at intake, before allocation is ever attempted.
inventory-storage accepted a reservation for a line.
Reservation state stays owned by inventory-storage; this fact carries only the line's identifying details for the funnel.
inventory-storage reported insufficient usable stock (HTTP 409).
Funnel leakage. A BUSINESS FACT only — never produced from a transport or 5xx failure (those fail the call outright instead).
Every line on the order is allocated (and released).
The funnel's allocated stage; the path dimension comes from the first released line (or an OrderRepo lookup when none were released).
Some lines allocated, some backordered.
Carries the allocated/backordered split for allocation-health reporting on partial-shipment orders.
A hard failure hit mid-allocation; some lines genuinely allocated.
Fail-closed visibility (ADR 0003): the already-succeeded reservations are kept, remaining lines stay Pending, and this fact makes the outcome observable rather than silent.
A line's work was announced as released to wes-work-planning.
Since ADR 0005 release is choreographed — there is no synchronous call — so this fact is announced per line, carrying the path the line was released onto and the deterministic work unit id.
A released line was never confirmed by wes-work-planning within the timeout.
ADR 0043. Raised ONCE per line, by the housekeeping sweep, when a PENDING release confirmation is older than RELEASE_CONFIRMATION_TIMEOUT (default 15m) without a WorkUnitCreated naming it. A FACT, never an action: nothing is cancelled, re-released or retried because of it, and it is not retracted if a late confirmation arrives. Analytics-only — the integration topic warehouse.order-management.events keeps its four-event contract (OrderAllocated, OrderPartiallyAllocated, OrderRepromised, SiteSkuDemandChanged) — and the in-repo projector ignores the type. subject and the Kafka key are the order id; time is when the line was flagged, released_at when it was released.
Every line on the order has been released as work.
The funnel's bottom stage.
The order was cancelled before any line was released.
Funnel leakage at the cancellation boundary (BR6): legal only while no line has reached Released. Revoked reservations were returned to inventory-storage.
The promise for a shipment group moved — the re-promise-rate KPI's source fact (ADR 0014 §6 / ADR 0019).
Published on the analytics topic since ADR 0019, closing a gap left when ADR 0018 shipped the RepromiseOrder consumer: this event was raised on the integration topic (warehouse.order-management.events) but never reached the analytics publisher's marshalData switch. Deliberately carries NO path_id, unlike every other analytics message on this channel — OrderRepromised itself has no process-path dimension in its domain event, and this data product tracks the re-promise-rate KPI fleet-wide rather than adding an OrderRepo lookup for a dimension nothing asked for (see ADR 0019's Decision §2 for the full reasoning). Unlike the integration-topic message, cpt_id_old/cpt_id_new are ALWAYS present on the analytics payload (no omitempty): the empty string for a LeadTime-basis promise on that side.
A process path was defined.
A process path definition changed.
A process path was deactivated.
A site's full CPT schedule snapshot.
wes-work-planning admitted a unit of work; confirms an order-line release (ADR 0043).
The enqueue confirmation. Since wes-work-planning's ADR 0041 its integration-stream data carries two OPTIONAL fields beside the existing path_id and work_unit_id: reference (the work unit's originating reference; for order work, the order id) and line_no (integer > 0; omitted when unknown). The CloudEvents type, subject (the work unit id) and dataschema v1 are unchanged. Only reference and line_no are read.
Remaining capacity for a path at an exact cutoff instant (ADR 0015).
A DRAFT capacity plan exists (stored as DRAFT; never influences an order).
A capacity plan was published (stored as PUBLISHED).
A published plan's demand exceeds its capacity over the window (stored as PUBLISHED with its shortage).
The path step limiting a plan with a shortage (recognised and ignored: CapacityShortageDetected carries bottleneck_step).
A newer plan of the same window replaced this one (stored as a terminal SUPERSEDED row that never influences an order; ADR 0052).
A product's handling classification was set or replaced (full state; applied when version > stored).
Consumed from warehouse.product-master.events (ADR 0036). Subject and Kafka key = the SKU. Full-state replacement of the classification; temperature_class and dot_hazard_class are omitted when unset. Tags come in product-master's stable order (Hazmat, Fragile, TemperatureSensitive, Oversized, HighValue). There is no "unclassify" event in v1.
CloudEvents 1.0 structured-mode event (JSON event format), the ONLY envelope on every channel this service produces or consumes (ADR 0030, fleet standard). Every attribute below is REQUIRED in this fleet. Kafka header content-type is application/cloudevents+json; charset=UTF-8; W3C trace context stays in the traceparent/tracestate headers. Consumers dispatch on the FULL type, ignore unknown types, and dedupe on id.
The data payload shape for OrderRepromised (ADR 0014 §5 / ADR 0018). cpt_id_old/cpt_id_new are both omitempty for a LeadTime-basis promise on that side.
The data payload shape for SiteSkuDemandChanged (ADR 0035): a PII-free snapshot of one source order line's demand at the resolved site (caller-assigned or static — see assignment_version). Deliberately does NOT reuse the frozen allocationData shape shared with wes-work-planning — this is a new, additive consumer contract.
fulfillment-execution's real, shipped TaskCPTMissed payload (its own ADR 0025 §7) — decoded independently here, never imported.
fulfillment-execution's real, shipped PackageManifested payload (its own ADR 0025 §7) — decoded independently here, never imported.
outbound-shipping's real, shipped ShipmentConfirmed payload (its merged apis/asyncapi.yaml) — decoded independently here, never imported. Only load_id and orders[].order_id are read by order-management (ADR 0051); the other members are decoded-and- ignored so additive producer fields stay forward-compatible.
outbound-shipping's real, shipped PackageMissedLoad payload — decoded independently here, never imported. source_order_id (a bare OrderId) drives the order-wide re-promise; cutoff is for logging; the rest is decoded-and-ignored (ADR 0051).
Frozen wire shape shared verbatim with wes-work-planning's Kafka consumer (see CLAUDE.md's Kafka integration section). promise_cpt_id/promise_basis are ADR 0014's additive fields (the CPT identity a Capability-basis promise targets, and which policy produced the promise) -- optional, since a LeadTime-basis promise has no CPT identity and older consumers may ignore both.
Deliberately has NO path_id property, unlike every other analytics event's data object on this channel — see OrderRepromisedAnalytics' own description for why (ADR 0014 §6 / ADR 0019).
process-path-management's ProcessPath* payload, decoded independently here (only the fields this service reads). eligibility is absent on ProcessPathDeactivated.
Full per-site CPT schedule snapshot (replaces the site's prior schedule).
wes-work-planning's PathCapacityChanged payload (ADR 0015).
wes-work-planning's WorkUnitCreated payload (integration stream). Only reference and line_no are read by order-management (ADR 0043); both are OPTIONAL and the other fields are ignored.
The fields order-management reads from warehouse-planning's CapacityPlanCreated / CapacityPlanPublished / CapacityShortageDetected payloads (its own apis/asyncapi.yaml; extra fields such as path_capacity, status and published_at are ignored). Quantities are orders; times are RFC 3339 UTC; window_end is exclusive.
warehouse-planning's BottleneckDetected payload (recognised, not applied).
warehouse-planning's CapacityPlanSuperseded payload (its ADR 0024 decision 3; order-management ADR 0052). plan_id is the OLDER plan and equals the CloudEvents subject; superseded_by is the newer plan. It carries no warehouse or quantities. The optional location (the same field the plan's other events carry) becomes a tombstone row's location, else site_id does; on a known row every stored fact is kept. window_end is exclusive.
product-master's ProductClassified payload (its apis/asyncapi.yaml, ADR 0004 there). order-management stores sku, handling_tags, temperature_class, dot_hazard_class and version; classification_source is decoded and ignored. A payload with an empty sku, a version below 1, or a sku that disagrees with the CloudEvents subject is skipped.