Bounded Context & System Boundaries
Define the operational scope, boundaries, and anti-corruption layer for the Inventory & WMS domain.
Bounded Context & System Boundaries
The Inventory & Warehouse Management System (WMS) operates as a highly isolated Bounded Context within the Obelaw open-core ERP ecosystem. By maintaining clear borders, the domain protects internal invariants from external mutations.
1. Operational Scope
The Inventory & WMS domain is strictly responsible for the lifecycle and custody of physical items within the enterprise’s ownership:
- Physical Custody: Tracking items from the exact moment they enter receiving zones until they cross the dispatch boundary.
- Spatial Topology: Managing the physical coordinates (Warehouse, Zone, Aisle, Rack, Shelf, Bin) and the constraints of those locations.
- Custody Shifts: Orchestrating double-entry ledger entries for relocations, stock reservations, and adjustments.
- Tracking Unit Lifecycles: Retaining absolute trace logs for Stock Keeping Units (SKUs), Serial Numbers (S/N), and Batch/Lot Numbers.
2. Out-of-Scope Boundaries
To maintain high cohesion and limit architectural drift, the domain explicitly excludes the following business operations:
- Financial Accounting (GL): Inventory does not write to the General Ledger. Valuation calculations, financial depreciation, and ledger double-entry postings belong to the Financial Management System (FMS).
- Sales & Pricing Contracts: Customer invoice generation, wholesale discounts, price tiers, and payment terms belong to the Sales Order context.
- Procurement Agreements: Supplier contract bids, request-for-quotes (RFQs), and billing reconciliations are isolated within the Purchasing context.
- Customer Relationship Management (CRM): Customer profiles, mailing preferences, and loyalty rewards belong to the Customer context.
3. Context Mapping & Integration Relationships
The Inventory & WMS Bounded Context interacts with external contexts using explicit, formal DDD relationship patterns. This ensures that changes in downstream or upstream domains do not corrupt internal WMS logic.
| Integrating Context | Relationship Type | Interaction Pattern | Business Purpose |
|---|---|---|---|
| Sales Order Context | Upstream (Sales) to Downstream (WMS) | Customer-Supplier | WMS reacts to approved Sales Orders to allocate and reserve physical stock. |
| Procurement Context | Upstream (Procurement) to Downstream (WMS) | Customer-Supplier | WMS reacts to Purchase Order shipping signals to prepare receiving dock capacity. |
| Financials (FMS) | Downstream (FMS) to Upstream (WMS) | Conformist (via ACL) | FMS conforms to the structural data emitted by WMS domain events to write ledger postings. |
| Product Catalog | Downstream (WMS) to Upstream (Catalog) | Anti-Corruption Layer | WMS maps external Product IDs to internal SKU strings, ensuring decoupled product metadata. |
4. Domain Isolation & Anti-Corruption Layer (ACL)
To keep WMS databases decoupled from sales, procurement, and financial database tables, the domain strictly enforces the following isolation policies:
Zero Direct Database Mappings
- No Shared Foreign Keys: The WMS database tables (Bins, Stocks, Lots) contain no foreign keys pointing directly to catalog tables, client directories, or purchasing ledgers.
- Polymorphic Reference Mappings: Relationships to external documents are linked using generic string-based polymorphic fields (
Owner TypeandOwner ID). This maps stock adjustments to aSalesOrder, aPurchaseOrder, or aProductionTicketwithout database-level coupling.
The Anti-Corruption Layer (ACL) Translation Engine
The ACL acts as a bidirectional translator on the context boundary. It validates, translates, and maps foreign data structures into internal, type-safe Data Transfer Objects (DTOs):
- Inbound Translation (Supplier Manifest → InboundReceipt DTO): Translates external vendor item numbers and supplier identifiers into local SKUs and maps receiving docks dynamically.
- Outbound Translation (Customer Order → AllocationRequest DTO): Converts sales line item identifiers into local SKU strings and triggers warehouse picking paths based on zone availability.
- Product Catalog Isolation: If the external Catalog domain alters its database schema (e.g. changing category trees or product relationships), the WMS context is completely unaffected. The ACL translates the catalog ID into a flat internal SKU, decoupling warehouse layouts from catalog hierarchies.