MRP / In-House MRP

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 NameEmitted WhenPayload Highlights
ManufacturingOrderPlannedA new Manufacturing Order is created from a demand signal.MO identifier, item code, BOM revision, routing, quantity, due date, source reference.
ManufacturingOrderConfirmedMaterial and capacity availability validated; order authorized.MO identifier, confirmed quantity, planned start/end dates, work center assignments.
RawMaterialsRequestedComponents are requested for staging or reservation.MO identifier, component lines, required quantities, target production location, issue method.
WorkOrderOperationStartedA routing operation begins on the shop floor.Operation identifier, work center, machine, operator, setup time, scheduled run time.
RawMaterialsConsumedComponents are consumed against an operation or order.MO identifier, operation, component lines, consumed quantities, lot/serial references.
OperationTimeLoggedOperator or machine time is recorded.Operation identifier, labor/machine hours, activity type, operator identity.
MachineDowntimeReportedA machine stoppage is recorded.Machine identifier, work center, downtime reason, duration, linked operation.
QualityInspectionCompletedInspection results are dispositioned.Operation identifier, accepted quantity, rejected quantity, disposition, inspector.
FinishedGoodsProducedAccepted output is reported ready for inventory receipt.MO identifier, item code, quantity, lot/serial, storage destination, by-products.
ScrapReportedDefective or non-reworkable output is recorded.MO identifier, operation, scrap quantity, reason code, cost variance.
ReworkWorkOrderCreatedA rework order is generated from failed inspection.Original MO reference, rework quantity, rework routing, disposition reason.
ManufacturingOrderClosedOrder 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 EventWMS ActionResulting WMS Document
RawMaterialsRequestedReserve or pick components from inventory bins and move to staging area.Reservation Slip, Pick List, or Internal Transfer Order.
RawMaterialsConsumedDeduct components from inventory; issue Goods Issue Note (GIN) for the consumed quantities.Goods Issue Note (GIN).
FinishedGoodsProducedReceive finished goods into available stock bins; record lot/serial and quarantine status.Goods Received Note (GRN).
ScrapReportedMove rejected quantity to scrap/quarantine location; adjust inventory buckets.Scrap Transfer Note or Inventory Adjustment.
ReworkWorkOrderCreatedHold 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 EventFMS ActionResulting Ledger Impact
ManufacturingOrderConfirmedEstablish WIP cost object; optionally post preliminary WIP reservation entries.WIP control account opened or memo record created.
RawMaterialsConsumedTransfer raw material asset value to WIP asset account.Debit WIP Inventory, Credit Raw Material Inventory.
OperationTimeLoggedCapitalize direct labor and machine overhead into WIP.Debit WIP Inventory, Credit Labor/Overhead Absorption accounts.
FinishedGoodsProducedTransfer WIP value to finished goods inventory at standard or actual cost.Debit Finished Goods Inventory, Credit WIP Inventory.
ScrapReportedRecord scrap loss or variance based on standard cost and disposition.Debit Scrap/Variance Account, Credit WIP Inventory (for excess scrap).
ManufacturingOrderClosedFinalize 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 EventCMMS ActionResulting Maintenance Document
MachineDowntimeReportedCreate 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.
WorkOrderOperationStartedUpdate 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 EventProcurement ActionResulting Procurement Document
ManufacturingOrderPlannedCompare 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.
ManufacturingOrderClosedUpdate 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 EventOMS ActionResulting Sales Document
ManufacturingOrderConfirmedUpdate available-to-promise (ATP) and production-confirmed delivery dates.Sales Order Line Promise Update.
FinishedGoodsProducedTrigger allocation of finished goods against awaiting sales orders.Allocation Release.
ManufacturingOrderClosedUpdate 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 ScenarioRule
WMS replayRe-execute inventory movements without duplicating physical stock if event was already applied.
FMS replayRe-post ledger entries using idempotency keys derived from source event identifiers.
CMMS replayRe-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 EventACL Translation for WMSACL Translation for FMS
RawMaterialsRequestedConvert component item codes to WMS SKU strings; enrich with production location.Map components to inventory asset accounts and WIP account.
FinishedGoodsProducedConvert FG item to WMS SKU; assign default receipt bin and lot.Calculate capitalized cost from WIP balance and post FG receipt.
ManufacturingOrderClosedConfirm 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.

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