ERP Core / Sales OMS

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 ConcernCorrect Ownership
Physical warehouse bin movements, picking, packing, or cycle countingInventory / WMS
Last-mile vehicle dispatching, carrier manifests, or route optimizationTMS / Logistics
Balanced double-entry ledger postings, tax accounting, or fiscal period closeAccounting / FMS
Customer master data, loyalty programs, or marketing campaignsCRM / Customer
Supplier negotiations, purchase orders, or vendor billsPurchases / 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 ContextRelationship TypeInteraction PatternBusiness Purpose
Catalog / Pricing ContextDownstream (OMS) to Upstream (Catalog)Anti-Corruption LayerOMS maps external product references into internal order line identifiers without catalog schema coupling.
Inventory / WMS ContextUpstream (OMS) to Downstream (WMS)Customer-SupplierWMS reacts to FulfillmentBatchReleased to allocate, pick, pack, and dispatch goods.
TMS / Logistics ContextUpstream (OMS) to Downstream (TMS)Customer-SupplierTMS reacts to OrderReadyForShipping to generate waybills and manage carrier handover.
Accounting / FMS ContextUpstream (OMS) to Downstream (FMS)Customer-SupplierFMS reacts to SalesOrderConfirmed or OrderDelivered to issue invoices and record receivables.
CRM / Customer ContextDownstream (OMS) to Upstream (CRM)Anti-Corruption LayerOMS 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 Type and Orderable Alias). An order line may reference a CatalogProduct, Bundle, or ServiceContract without database-level coupling.

The Anti-Corruption Layer (ACL) Translation Engine

The ACL acts as a bidirectional translator on the context boundary:

  1. Inbound Translation (Channel Order → Unified Order DTO): Translates e-commerce cart payloads, B2B EDI messages, or POS receipts into a normalized internal order representation.
  2. 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.
  3. 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.

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