In-House MRP - Domain Events & Integration Contracts
Domain events, integration contracts, and asynchronous reactions between In-House Manufacturing and the broader Obelaw ecosystem.
Domain Events & Integration Contracts
In-House Manufacturing communicates with the rest of the Obelaw ecosystem exclusively through domain events and integration contracts. This event-driven architecture preserves domain boundaries, enables asynchronous processing, and allows downstream contexts to react to production facts without direct coupling.
1. Domain Events Emitted
The following table lists the primary domain events emitted by the In-House Manufacturing bounded context.
| Event Name | Emitted When | Payload Highlights |
|---|---|---|
| ManufacturingOrderPlanned | A new Manufacturing Order is created from a demand signal. | MO identifier, item code, BOM revision, routing, quantity, due date, source reference. |
| ManufacturingOrderConfirmed | Material and capacity availability validated; order authorized. | MO identifier, confirmed quantity, planned start/end dates, work center assignments. |
| RawMaterialsRequested | Components are requested for staging or reservation. | MO identifier, component lines, required quantities, target production location, issue method. |
| WorkOrderOperationStarted | A routing operation begins on the shop floor. | Operation identifier, work center, machine, operator, setup time, scheduled run time. |
| RawMaterialsConsumed | Components are consumed against an operation or order. | MO identifier, operation, component lines, consumed quantities, lot/serial references. |
| OperationTimeLogged | Operator or machine time is recorded. | Operation identifier, labor/machine hours, activity type, operator identity. |
| MachineDowntimeReported | A machine stoppage is recorded. | Machine identifier, work center, downtime reason, duration, linked operation. |
| QualityInspectionCompleted | Inspection results are dispositioned. | Operation identifier, accepted quantity, rejected quantity, disposition, inspector. |
| FinishedGoodsProduced | Accepted output is reported ready for inventory receipt. | MO identifier, item code, quantity, lot/serial, storage destination, by-products. |
| ScrapReported | Defective or non-reworkable output is recorded. | MO identifier, operation, scrap quantity, reason code, cost variance. |
| ReworkWorkOrderCreated | A rework order is generated from failed inspection. | Original MO reference, rework quantity, rework routing, disposition reason. |
| ManufacturingOrderClosed | Order is completed, costed, and sealed. | MO identifier, final quantities, total cost, variance summary, capitalization facts. |
2. Integration Contracts & Asynchronous Reactions
Downstream contexts subscribe to manufacturing events and translate them into their own internal workflows. The In-House Manufacturing context does not know how these reactions are implemented; it only publishes facts.
Inventory / WMS Reactions
| Subscribed Event | WMS Action | Resulting WMS Document |
|---|---|---|
| RawMaterialsRequested | Reserve or pick components from inventory bins and move to staging area. | Reservation Slip, Pick List, or Internal Transfer Order. |
| RawMaterialsConsumed | Deduct components from inventory; issue Goods Issue Note (GIN) for the consumed quantities. | Goods Issue Note (GIN). |
| FinishedGoodsProduced | Receive finished goods into available stock bins; record lot/serial and quarantine status. | Goods Received Note (GRN). |
| ScrapReported | Move rejected quantity to scrap/quarantine location; adjust inventory buckets. | Scrap Transfer Note or Inventory Adjustment. |
| ReworkWorkOrderCreated | Hold rework quantity in quarantine or WIP location pending rework execution. | Quarantine Hold Record. |
Responsibility Boundary
- Manufacturing decides how much material should be consumed based on BOM, scrap, and output.
- WMS decides from which bin, lot, or location the material is physically issued or received.
- Manufacturing never instructs WMS on bin-level decisions; WMS never instructs Manufacturing on BOM quantities.
Accounting / FMS Reactions
| Subscribed Event | FMS Action | Resulting Ledger Impact |
|---|---|---|
| ManufacturingOrderConfirmed | Establish WIP cost object; optionally post preliminary WIP reservation entries. | WIP control account opened or memo record created. |
| RawMaterialsConsumed | Transfer raw material asset value to WIP asset account. | Debit WIP Inventory, Credit Raw Material Inventory. |
| OperationTimeLogged | Capitalize direct labor and machine overhead into WIP. | Debit WIP Inventory, Credit Labor/Overhead Absorption accounts. |
| FinishedGoodsProduced | Transfer WIP value to finished goods inventory at standard or actual cost. | Debit Finished Goods Inventory, Credit WIP Inventory. |
| ScrapReported | Record scrap loss or variance based on standard cost and disposition. | Debit Scrap/Variance Account, Credit WIP Inventory (for excess scrap). |
| ManufacturingOrderClosed | Finalize cost capitalization, post variance entries, and close WIP object. | WIP closed; variances posted to P&L or variance accounts. |
Responsibility Boundary
- Manufacturing emits cost facts (material quantities, labor hours, machine hours, output quantities).
- FMS applies chart of accounts, valuation method, and capitalization rules.
- Manufacturing does not post journal entries; FMS does not calculate shop-floor variances.
Maintenance / CMMS Reactions
| Subscribed Event | CMMS Action | Resulting Maintenance Document |
|---|---|---|
| MachineDowntimeReported | Create or update maintenance request; schedule corrective inspection. | Maintenance Work Order or Breakdown Ticket. |
| MachineDowntimeReported (pattern) | Trigger preventive maintenance if downtime crosses threshold. | Preventive Maintenance Schedule Adjustment. |
| WorkOrderOperationStarted | Update machine utilization statistics and runtime counters. | Asset Utilization Record. |
Responsibility Boundary
- Manufacturing reports downtime facts, machine usage, and operational context.
- CMMS owns maintenance scheduling, spare parts, and asset health decisions.
- Manufacturing may receive calendar lockout updates from CMMS but does not own them.
Procurement Reactions
| Subscribed Event | Procurement Action | Resulting Procurement Document |
|---|---|---|
| ManufacturingOrderPlanned | Compare component requirements against open purchase commitments. | Exception report or expedite recommendation. |
| RawMaterialsRequested (shortage) | Trigger emergency purchase requisition for missing components. | Purchase Requisition or Expedite Request. |
| ManufacturingOrderClosed | Update supplier performance metrics based on material availability. | Supplier Scorecard Update. |
Responsibility Boundary
- Manufacturing signals material demand and shortages.
- Procurement owns vendor engagement, purchase orders, and supplier contracts.
Sales / OMS Reactions
| Subscribed Event | OMS Action | Resulting Sales Document |
|---|---|---|
| ManufacturingOrderConfirmed | Update available-to-promise (ATP) and production-confirmed delivery dates. | Sales Order Line Promise Update. |
| FinishedGoodsProduced | Trigger allocation of finished goods against awaiting sales orders. | Allocation Release. |
| ManufacturingOrderClosed | Update order fulfillment status and notify customer service of completion. | Fulfillment Status Update. |
Responsibility Boundary
- Manufacturing confirms production capability and completion facts.
- OMS owns customer promise management, allocation, and shipment scheduling.
3. Event Sourcing & Replay Considerations
Because manufacturing state is reconstructed from immutable event history, downstream contexts can replay events for recovery, audit, or reprocessing:
| Replay Scenario | Rule |
|---|---|
| WMS replay | Re-execute inventory movements without duplicating physical stock if event was already applied. |
| FMS replay | Re-post ledger entries using idempotency keys derived from source event identifiers. |
| CMMS replay | Re-create maintenance requests only if not already linked to the same downtime event. |
All events carry a unique event identifier, timestamp, source MO/WO reference, and correlation identifier to support idempotent processing and end-to-end traceability.
4. Anti-Corruption Layer in Event Flow
The ACL validates and translates manufacturing events before they cross context boundaries:
┌─────────────────────┐ ┌─────────────────────────────┐ ┌─────────────────────┐
│ In-House MRP │ │ Anti-Corruption Layer │ │ Downstream Context │
│ (Event Publisher) │ ───► │ (Validate / Translate / │ ───► │ (Event Subscriber) │
│ │ │ Enrich / Drop) │ │ │
└─────────────────────┘ └─────────────────────────────┘ └─────────────────────┘
ACL Translation Examples
| Manufacturing Event | ACL Translation for WMS | ACL Translation for FMS |
|---|---|---|
RawMaterialsRequested | Convert component item codes to WMS SKU strings; enrich with production location. | Map components to inventory asset accounts and WIP account. |
FinishedGoodsProduced | Convert FG item to WMS SKU; assign default receipt bin and lot. | Calculate capitalized cost from WIP balance and post FG receipt. |
ManufacturingOrderClosed | Confirm no open pick/putaway transactions. | Generate final WIP-to-FG and variance journal vouchers. |
This event-driven, ACL-protected integration model ensures that In-House Manufacturing remains a pure, autonomous domain while participating fully in the broader ERP ecosystem.