Sales OMS - Bounded Context & System Boundaries
Define the operational scope, boundaries, and anti-corruption layer for the Sales & Order Management domain.
Bounded Context & System Boundaries
The Sales & Order Management System (Sales / OMS) operates as a central commercial bounded context within the Obelaw open-core ERP ecosystem. It governs the entire commercial lifecycle of customer demand, from quotation and pricing agreement through order confirmation, fulfillment orchestration, and post-sale returns.
By maintaining strict boundaries, the domain protects commercial commitments from uncontrolled mutation and ensures that downstream fulfillment, logistics, and financial contexts receive clear, event-driven signals.
1. Operational Scope
The Sales / OMS domain is strictly responsible for the following capabilities:
- Commercial Agreements: Management of quotations, pricing tiers, commercial discounts, and customer-specific terms before an order is confirmed.
- Omnichannel Order Ingestion: Capture of demand from B2B portals, e-commerce storefronts, mobile applications, retail POS systems, and manual sales desks into a unified pipeline.
- Order Routing & Splitting: Determination of optimal fulfillment sources and splitting of orders into multiple shipments when a single node cannot satisfy the entire order.
- Allocation Policies: Soft reservation of stock during order capture and hard allocation of inventory at fulfillment release.
- Reverse Logistics / Returns Orchestration (RMA): Authorization and tracking of customer returns, refunds, and replacements.
2. Out-of-Scope Boundaries
To preserve domain purity and prevent architectural drift, the Sales / OMS context explicitly excludes the following business operations:
| Out-of-Scope Concern | Correct Ownership |
|---|---|
| Physical warehouse bin movements, picking, packing, or cycle counting | Inventory / WMS |
| Last-mile vehicle dispatching, carrier manifests, or route optimization | TMS / Logistics |
| Balanced double-entry ledger postings, tax accounting, or fiscal period close | Accounting / FMS |
| Customer master data, loyalty programs, or marketing campaigns | CRM / Customer |
| Supplier negotiations, purchase orders, or vendor bills | Purchases / Procurement |
Sales / OMS may emit events consumed by these contexts, but it never owns their internal workflows.
3. Context Mapping & Integration Relationships
The Sales / OMS Bounded Context interacts with external contexts using explicit, formal DDD relationship patterns. This ensures that changes in upstream or downstream domains do not corrupt internal commercial logic.
| Integrating Context | Relationship Type | Interaction Pattern | Business Purpose |
|---|---|---|---|
| Catalog / Pricing Context | Downstream (OMS) to Upstream (Catalog) | Anti-Corruption Layer | OMS maps external product references into internal order line identifiers without catalog schema coupling. |
| Inventory / WMS Context | Upstream (OMS) to Downstream (WMS) | Customer-Supplier | WMS reacts to FulfillmentBatchReleased to allocate, pick, pack, and dispatch goods. |
| TMS / Logistics Context | Upstream (OMS) to Downstream (TMS) | Customer-Supplier | TMS reacts to OrderReadyForShipping to generate waybills and manage carrier handover. |
| Accounting / FMS Context | Upstream (OMS) to Downstream (FMS) | Customer-Supplier | FMS reacts to SalesOrderConfirmed or OrderDelivered to issue invoices and record receivables. |
| CRM / Customer Context | Downstream (OMS) to Upstream (CRM) | Anti-Corruption Layer | OMS references customers through lightweight aliases without owning customer profiles. |
4. Domain Isolation & Anti-Corruption Layer (ACL)
Sales / OMS communicates with the rest of the ecosystem asynchronously through domain events and lightweight polymorphic references. It never holds direct foreign keys to catalog tables, warehouse bins, carrier records, or customer profiles.
Zero Direct Database Mappings
- No Shared Foreign Keys: Sales / OMS tables contain no foreign keys pointing directly to product catalogs, inventory lots, warehouse locations, or customer master records.
- Polymorphic Reference Mappings (Morph Aliases): Relationships to external documents are linked using generic, string-based polymorphic fields (
Orderable TypeandOrderable Alias). An order line may reference aCatalogProduct,Bundle, orServiceContractwithout database-level coupling.
The Anti-Corruption Layer (ACL) Translation Engine
The ACL acts as a bidirectional translator on the context boundary:
- Inbound Translation (Channel Order → Unified Order DTO): Translates e-commerce cart payloads, B2B EDI messages, or POS receipts into a normalized internal order representation.
- Outbound Translation (Confirmed Order → Fulfillment Request): Converts a confirmed sales order into a fulfillment instruction consumed by WMS, including line quantities, sourcing nodes, and shipping priorities.
- Customer Alias Isolation: If the CRM domain restructures customer segmentation or contact schemas, the OMS context is unaffected. The ACL translates the customer reference into a stable internal alias.
Because the ACL owns all cross-boundary translations, changes to Catalog, WMS, TMS, or CRM schemas do not force changes to Sales / OMS internals.