ERP Core / Purchase

Purchase - Domain Events & Integration Contracts

Domain events emitted by Purchases and downstream integration contracts with Inventory and Accounting.

Domain Events & Integration Contracts

The Purchases & Procurement domain communicates with the rest of the Obelaw ecosystem through a strict event-driven contract. It emits procurement events for downstream consumers and consumes demand signals to initiate sourcing activity.


1. Events Emitted by Purchases

Domain EventEmitted WhenConsumers
PurchaseOrderApprovedA purchase order completes approval and becomes a binding commitment.Inventory / WMS, Planning, Notifications
VendorBillMatchedA vendor bill passes 3-way matching and is ready for payment authorization.Accounting / FMS, Treasury
VendorBillRejectedA vendor bill fails 3-way matching or is rejected during discrepancy workflow.Procurement, Supplier Portal, Accounting
PurchaseOrderClosedA purchase order is fully received, billed, and settled with no remaining open commitment.Planning, Budgeting, Reporting
SupplierPerformanceRecordedFulfillment metrics such as on-time delivery or quality rejection are captured.Supplier Scorecards, Reporting

Event Payload Characteristics

Emitted events contain only procurement-relevant facts:

  • Document reference and version timestamp.
  • Supplier organization and site identifiers.
  • Line-level quantities, prices, currencies, and UOMs.
  • Morph alias linking back to originating PR, PO, or RTV document.
  • Actor identity who triggered the transition.

They do not expose internal details from Inventory, Accounting, or Customer contexts.


2. Downstream Integration Contracts

Inventory / WMS Listens to PurchaseOrderApproved

When Procurement emits PurchaseOrderApproved, the Inventory / WMS context uses it to prepare inbound logistics:

WMS ActionPurpose
Advance Shipping Notice (ASN) stagingReserve receiving dock capacity based on expected delivery date and quantity.
Inbound Receiving expectationCreate a pending receiving record linked by PO reference alias.
Quality Inspection queueFlag items requiring inspection or certificate verification upon arrival.

The WMS does not query Procurement tables directly; it consumes the event payload and stores only its own polymorphic reference back to the PO.

Accounting / FMS Listens to VendorBillMatched

When Procurement emits VendorBillMatched, the Accounting / FMS context posts the corresponding accounts payable journal entry:

FMS ActionPurpose
AP liability recognitionDebit expense or asset account, credit accounts payable.
Landed cost allocationDistribute freight, duty, and handling costs across received lines.
Variance recordingPost quantity and price variance accounts when tolerances are exceeded but approved.

The FMS does not read vendor bill details from Procurement after the event; it relies on the matched payload delivered through the ACL.


3. Inbound Events Consumed by Purchases

Operational EventSource ContextProcurement Action
StockReplenishmentSignalInventory / PlanningGenerate a purchase requisition for items below reorder point.
ProductionMaterialDemandManufacturing / MRPGenerate a purchase requisition for raw material requirements.
GoodsReceivedNoteConfirmedInventory / WMSUpdate PO receipt status and make quantities available for bill matching.
QualityRejectionRecordedInventory / WMSTrigger debit note issuance and return-to-vendor workflow.

These events are translated through the ACL into internal procurement commands without direct database coupling to operational contexts.

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