Sales OMS - Domain Events & Integration Contracts
Domain events emitted by Sales / OMS and downstream integration contracts.
Domain Events & Integration Contracts
The Sales / OMS domain communicates with the rest of the Obelaw ecosystem through a strict event-driven contract. It emits commercial and fulfillment events for downstream consumers and consumes channel-specific demand signals.
1. Events Emitted by Sales / OMS
| Domain Event | Emitted When | Consumers |
|---|---|---|
| QuotationAccepted | A customer accepts a quotation and triggers order conversion. | Sales Pipeline, Notifications |
| SalesOrderConfirmed | A sales order passes validation and becomes a binding commitment. | Inventory / WMS, Accounting / FMS, Notifications |
| FulfillmentBatchReleased | A batch of order lines is released to a specific fulfillment node. | Inventory / WMS |
| OrderSplitted | A single order is split into multiple fulfillment batches or shipments. | Inventory / WMS, TMS, Customer Notifications |
| OrderCancelled | A sales order or line is formally cancelled according to governance rules. | Inventory / WMS, Accounting / FMS, Customer Notifications |
| ReturnAuthorized | An RMA is approved and goods may be returned. | Inventory / WMS, Customer Service |
Event Payload Characteristics
Emitted events contain only commercial and fulfillment-relevant facts:
- Order reference, channel, and customer alias.
- Line-level product aliases, quantities, prices, and discounts.
- Sourcing node assignments and shipping schedules.
- Actor identity and transition timestamp.
They do not expose internal WMS, TMS, or Accounting internals.
2. Downstream Integration Contracts
Inventory / WMS Listens to FulfillmentBatchReleased
When Sales / OMS emits FulfillmentBatchReleased, the Inventory / WMS context initiates physical fulfillment:
| WMS Action | Purpose |
|---|---|
| Hard allocation confirmation | Convert the OMS allocation into a firm pick task. |
| Pick task generation | Create instructions for warehouse operators to retrieve stock from bins. |
| Pack & ship preparation | Group picked items into shipping containers and generate Delivery Notes. |
| Goods Issue Note (GIN) | Record the legal removal of stock from warehouse custody. |
The WMS does not query OMS tables directly; it consumes the event payload and stores only its own polymorphic reference back to the sales order.
TMS / Logistics Listens to OrderReadyForShipping
When WMS completes packing and emits OrderReadyForShipping, the TMS context prepares last-mile delivery:
| TMS Action | Purpose |
|---|---|
| Carrier selection | Choose carrier based on service level, cost, and destination. |
| Waybill generation | Produce tracking numbers and shipping labels. |
| Route staging | Assign parcels to delivery routes or collection manifests. |
| Delivery tracking | Capture carrier events and feed them back as DeliveryConfirmed or DeliveryFailed. |
Accounting / FMS Listens to SalesOrderConfirmed and OrderDelivered
The Accounting / FMS context uses commercial events to recognize revenue and receivables:
| FMS Action | Purpose |
|---|---|
| Invoice issuance | Generate a customer invoice based on confirmed order lines. |
| Revenue recognition | Record sales revenue in the appropriate accounts. |
| Accounts Receivable (AR) | Debit customer receivable for the invoiced amount. |
| Tax recording | Capture tax liabilities by jurisdiction. |
The FMS does not read order details directly from OMS after the event; it relies on the matched commercial payload delivered through the ACL.
3. Inbound Events Consumed by Sales / OMS
| Operational Event | Source Context | Sales / OMS Action |
|---|---|---|
| CartSubmitted | E-Commerce / Mobile | Ingest and canonicalize the channel order. |
| CustomerContractUpdated | CRM / Customer | Refresh customer-specific pricing tiers and terms. |
| DeliveryConfirmed | TMS / Logistics | Mark order batch as delivered and trigger invoicing. |
| StockReplenished | Inventory / WMS | Release backordered lines when ATP becomes available. |
| ReturnReceived | Inventory / WMS | Advance RMA to inspection and credit disposition. |
These events are translated through the ACL into internal OMS commands without direct database coupling to operational contexts.