MRP / Subcontracting MRP

Subcontracting MRP - Bounded Context & System Boundaries

Define the operational scope, boundaries, and anti-corruption layer for the Subcontracting & Toll Manufacturing domain.

Bounded Context & System Boundaries

The Subcontracting & Toll Manufacturing domain operates as a dedicated bounded context within the Obelaw open-core ERP ecosystem. It governs the complete lifecycle of contracting third-party manufacturers—tollers, co-packers, and external converters—to transform company-owned raw materials or components into finished goods, while preserving legal ownership and cost traceability throughout the custody chain.

By maintaining strict boundaries, the domain ensures that assets dispatched to external premises remain on the company’s books, that finished receipts are coupled with verifiable consumption, and that downstream financial capitalization reflects the true landed cost of production.


1. Operational Scope

The Subcontracting domain is strictly responsible for the following capabilities:

  • Subcontracting Order (SCO) Management: Authorizing external production runs against approved subcontractors, BOMs, and conversion rates.
  • Component Custody Transfer: Recording the outbound movement of raw materials, packaging, or semi-finished goods from company-owned locations to subcontractor virtual locations.
  • Finished Goods Receipt: Receiving finished output from the subcontractor, including inspection, quarantine, and acceptance into sellable inventory.
  • Automated Backflushing: Deducting consumed component quantities from the subcontractor virtual location based on the approved BOM and actual finished output.
  • Service Cost Settlement: Linking tolling fees, setup charges, and processing services to the subcontracting order for downstream capitalization and vendor payment.
  • Subcontractor Performance Tracking: Monitoring yield achievement, scrap rates, on-time delivery, and quality conformance.

2. Out-of-Scope Boundaries

To preserve domain purity, the Subcontracting context explicitly excludes the following business operations:

Out-of-Scope ConcernCorrect Ownership
Internal manufacturing execution, shop-floor routing, or machine schedulingManufacturing / MES
General inventory valuation, cost layer calculations, and moving average updatesInventory / WMS
General Ledger postings, work-in-process capitalization, and period closeAccounting / FMS
Supplier onboarding, vendor qualification, or purchase order issuance for standard goodsProcurement
Customer sales orders, pricing, and outbound shipment executionSales / OMS

Subcontracting may emit events consumed by these contexts, but it does not own their internal workflows or ledger policies.


3. Cross-Domain Integration

Subcontracting is inherently cross-functional. It orchestrates physical custody, formulation data, procurement commitments, and financial capitalization through well-defined, event-driven contracts.

Integrating ContextRelationship TypeInteraction PatternBusiness Purpose
Inventory / WMSBidirectionalPartnerSubcontracting dispatches components to and receives finished goods from external locations; WMS owns the bin-level custody, lot tracking, and stock buckets.
ProcurementUpstream (Procurement) to Downstream (Subcontracting)Customer-SupplierProcurement issues the service purchase order and vendor contract; Subcontracting consumes the commitment and reports receipt/completion for bill matching.
PIM / BOMUpstream (PIM/BOM) to Downstream (Subcontracting)Customer-SupplierSubcontracting consumes approved, versioned BOMs and conversion ratios to validate SCO lines and drive backflushing.
Accounting / FMSUpstream (Subcontracting) to Downstream (FMS)Customer-SupplierSubcontracting emits cost capitalization facts so FMS can capitalize raw material value and tolling fees into finished inventory cost.

Integration Responsibilities

  • Inventory / WMS owns the physical location model, lot numbers, bin transfers, and quarantine status. It does not decide how much to consume; it applies consumption payloads emitted by Subcontracting.
  • Procurement owns the commercial contract with the toller, the service PO, and the vendor bill. It does not manage component stock or BOM-driven consumption.
  • PIM / BOM owns the formulation, version control, and yield assumptions. It does not execute transfers or receipts.
  • Accounting / FMS owns the ledger, asset capitalization rules, and accounts payable. It does not calculate consumption quantities or yield variances.

4. Domain Isolation & Anti-Corruption Layer (ACL)

Subcontracting communicates with the rest of the ecosystem asynchronously through domain events and lightweight polymorphic references. It never holds direct foreign keys to operational tables owned by Inventory, Procurement, PIM, or Accounting.

Zero Direct Database Mappings

  • No Shared Foreign Keys: Subcontracting tables contain no foreign keys pointing directly to warehouse bins, inventory lots, GL accounts, vendor master records, or BOM revision tables.
  • Polymorphic Reference Mappings (Morph Aliases): Relationships to external documents are linked using generic, string-based polymorphic fields (Owner Type and Owner Alias). A Subcontracting Order may reference a ProcurementServiceOrder, a BOMRevision, or a SalesForecast 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 (Procurement Commitment → SCO DTO): Translates an approved service purchase order into an internal Subcontracting Order with BOM references, expected yield, and component requirements.
  2. Inbound Translation (BOM Revision → Consumption Profile): Converts an approved BOM revision into a component consumption profile used for dispatch planning and backflushing.
  3. Outbound Translation (Receipt Completed → Capitalization Payload): Translates a finished-goods receipt and its associated backflushed components into a cost capitalization instruction for FMS.
  4. Outbound Translation (Completion Event → Vendor Bill Matching): Sends receipt evidence and service completion facts to Procurement so the vendor bill can be matched and scheduled for payment.

Because the ACL owns all cross-boundary translations, changes to the Inventory, Procurement, PIM, or Accounting schemas do not force changes to Subcontracting 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