ERP Core / Sales OMS

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 EventEmitted WhenConsumers
QuotationAcceptedA customer accepts a quotation and triggers order conversion.Sales Pipeline, Notifications
SalesOrderConfirmedA sales order passes validation and becomes a binding commitment.Inventory / WMS, Accounting / FMS, Notifications
FulfillmentBatchReleasedA batch of order lines is released to a specific fulfillment node.Inventory / WMS
OrderSplittedA single order is split into multiple fulfillment batches or shipments.Inventory / WMS, TMS, Customer Notifications
OrderCancelledA sales order or line is formally cancelled according to governance rules.Inventory / WMS, Accounting / FMS, Customer Notifications
ReturnAuthorizedAn 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 ActionPurpose
Hard allocation confirmationConvert the OMS allocation into a firm pick task.
Pick task generationCreate instructions for warehouse operators to retrieve stock from bins.
Pack & ship preparationGroup 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 ActionPurpose
Carrier selectionChoose carrier based on service level, cost, and destination.
Waybill generationProduce tracking numbers and shipping labels.
Route stagingAssign parcels to delivery routes or collection manifests.
Delivery trackingCapture 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 ActionPurpose
Invoice issuanceGenerate a customer invoice based on confirmed order lines.
Revenue recognitionRecord sales revenue in the appropriate accounts.
Accounts Receivable (AR)Debit customer receivable for the invoiced amount.
Tax recordingCapture 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 EventSource ContextSales / OMS Action
CartSubmittedE-Commerce / MobileIngest and canonicalize the channel order.
CustomerContractUpdatedCRM / CustomerRefresh customer-specific pricing tiers and terms.
DeliveryConfirmedTMS / LogisticsMark order batch as delivered and trigger invoicing.
StockReplenishedInventory / WMSRelease backordered lines when ATP becomes available.
ReturnReceivedInventory / WMSAdvance RMA to inspection and credit disposition.

These events are translated through the ACL into internal OMS commands without direct database coupling to operational contexts.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw