Events
Outbox types are written with OutboxWriterService inside prisma.$transaction. The worker dispatcher emits the eventType string.
Outbox types
| eventType | Producers found | Listeners |
|---|---|---|
order.created | order command, marketplace ingestion | OrderFulfillmentListener |
order.confirmed | order command | WalletListener |
order.location.changed | order command | OrderFulfillmentListener |
order.status.changed | order status service, return command | OrderFulfillmentListener, OutboundOrderSyncListener |
order.address.resolution_triggered | order command | WhatsAppAddressResolutionListener |
stock.sync.requested | order command, stock count, fulfillment, returns, stock transfer, goods receipt, allocation | ProductStockSyncListener |
stock.received | stock command | StockAllocationListener |
Constants: STOCK_EVENTS.SYNC_REQUESTED = stock.sync.requested, STOCK_EVENTS.RECEIVED = stock.received.
Payload classes under src/common/events (for example OrderCreatedEvent) exist. Dispatch is still the string name.
Code map
| Piece | Path |
|---|---|
| Fulfillment on order events | order-fulfillment.listener.ts |
| Wallet debit | wallet.listener.ts |
| Outbound channel status | outbound-order-sync.listener.ts |
| Stock arrival | stock-allocation.listener.ts |
| Inventory publish buffer | product-stock-sync.listener.ts |
| WhatsApp address | whatsapp-address-resolution.listener.ts |
| Shipment to fulfillment | shipment-fulfillment.listener.ts |
| NDR | ndr-shipment.listener.ts |
| Return shipment | return-shipment.listener.ts |
shipment.status.changed is in-process, not an outbox type found in the enqueue scan.
Failure
A throw inside the business transaction rolls back the aggregate and the outbox row together. A throw in a listener happens after commit. The dispatcher retries. See Wallet debit for the comment that disagrees with the throw.
How to add an event: Adding an event.