Skip to main content

Event catalogue

Summary of apis/asyncapi.yaml (AsyncAPI 2.6.0, version 1.0.0). The file is the authority for payload fields; ADR 0004 is the type catalogue and Domain events carries the field-level detail.

Envelope​

Every message, published or consumed, is a CloudEvents 1.0 event in structured content mode with the Kafka header content-type: application/cloudevents+json; charset=UTF-8.

AttributeValue
specversion1.0
idUUID minted once per domain event at encode time and persisted with the outbox row; consumers dedupe on it
source/warehouse/returns-processing
typecom.warehouse.wms.returns-processing.<entity>.<EventName> with <entity> one of returnauthorization, returnreceipt, disposition
subjectthe aggregate instance id (rma-…, rcpt-… or disp-…)
timedomain occurred-at, UTC
datacontenttypeapplication/json
dataschemaurn:warehouse:returns-processing:events:<EventName>:v1

The Kafka key is the subject. A breaking payload change gets a new .v2 type and dataschema; an existing one is never mutated.

Published​

Topic warehouse.returns-processing.events, written by the outbox relay only (ADR 0005). Every event is also mirrored on warehouse.returns-processing.analytics (same id, same payload, analytics dataschema), consumed only by this service's own projector (ADR 0007; see Analytics).

Type suffixRaisedPayload (data)
returnauthorization.ReturnAuthorizedPOST /returns (a manifested, in-window line)rma_id, order_id, line_no, sku, quantity, site_id, reason_code, window_ends_at, authorized_at
returnauthorization.ReturnAuthorizationRejecteddeclared, not raised today: no use case rejects (POST /returns answers a refusal with 409 and publishes nothing)rma_id, order_id, line_no, sku, quantity, rejection_code, rejected_at
returnreceipt.ReturnReceiptOpenedPOST /returns/{rmaId}/receiptsreceipt_id, rma_id (nullable), site_id, opened_at, lines:[{line_no, sku, quantity, rma_id (nullable)}]
returnreceipt.UnexpectedReturnReceiveda received line with no RMAreceipt_id, line_no, sku, quantity, site_id, received_at
returnreceipt.ReturnLineInspectedPOST /receipts/{receiptId}/lines/{lineNo}/inspectionsreceipt_id, line_no, sku, quantity, grade, reason_codes:[], inspected_at
disposition.DispositionDecidedinspection (policy) or POST /dispositions/{id}/overridesdisposition_id, receipt_id, line_no, sku, quantity, grade, outcome, policy_version, supersedes (nullable), reason (nullable), decided_at
disposition.ReturnLineStagedexactly once per RESTOCK dispositionreceipt_id, line_no, sku, quantity, condition, received_at, rma_id, disposition_id, site_id

Downstream consumers (verified on their origin/develop, 2026-10-21): inventory-storage consumes ReturnLineStaged into its staged-receipt use case (its ADR 0044; disposition_id is its idempotency key); exception-management consumes UnexpectedReturnReceived to open a problem-solve case. Outbox rows the encoder refuses are dead-lettered to warehouse.returns-processing.events.dlq.

Consumed​

TypeTopicConsumer group env
com.warehouse.wms.product-master.product.ProductClassifiedwarehouse.product-master.eventsPRODUCT_CLASSIFICATION_CONSUMER_GROUP
com.warehouse.wes.order-management.order.OrderAllocatedwarehouse.order-management.eventsORDER_LINES_CONSUMER_GROUP
com.warehouse.wes.order-management.order.OrderPartiallyAllocatedwarehouse.order-management.eventsORDER_LINES_CONSUMER_GROUP
com.warehouse.wes.fulfillment-execution.package.PackageManifestedwarehouse.fulfillment.eventsMANIFEST_CONSUMER_GROUP

Local-copy rules: one row per key (sku / (order, line) / work unit), apply only newer versions where a version exists, insert when absent; dedupe on the CloudEvents id in the same transaction as the effect; commit the offset only after success. Every other type on those topics commits past untouched; anything that is not a valid CloudEvent is WARN-logged and skipped; a payload that can never apply dead-letters to <topic>.dlq (Runbook).