ERP Core / Accounting

Accounting - Domain Events & Integration Contracts

Domain events emitted by the FMS and operational events consumed through the anti-corruption layer.

Domain Events & Integration Contracts

The Accounting & FMS domain communicates with the rest of the Obelaw ecosystem through a strict event-driven contract. It emits financial events for downstream consumers and consumes operational events to construct automated ledger postings.


1. Events Emitted by Accounting

Domain EventEmitted WhenConsumers
JournalEntryPostedA journal voucher is successfully posted to the GL.Reporting, Audit Log, Notification Bus.
FiscalPeriodClosedAn accounting period is closed and locked.Reporting, Tax Engine, Consolidation Services.
AccountBalanceThresholdBreachedAn account balance crosses a defined control limit.Treasury, Risk Management, Alerts.
JournalEntryReversedA posted entry is reversed by a reversal voucher.Audit Log, Reporting, Operational Subscribers.

Event Payload Characteristics

Emitted events contain only ledger-relevant facts:

  • Voucher reference and posting timestamp.
  • Total debit and credit amounts per currency.
  • Source alias and morph type for traceability.
  • Actor identity who performed the action.

They do not expose internal operational details from originating contexts.


2. Events Consumed by Accounting

Accounting listens to operational events and translates them into balanced journal entries through background dispatchers:

Operational EventSource ContextAccounting Action
InvoiceCreatedSales / BillingRecord revenue and receivables.
CashOnDeliveryCollectedPOS / DeliveryRecord cash increase and revenue realization.
RawMaterialsConsumedInventory / ManufacturingRecord work-in-process or cost of goods sold.
PaymentReceivedReceivablesReduce receivables and increase cash/bank.
BillApprovedPurchasingRecord expense and accounts payable.

Translation Through the ACL

The ACL ensures that Accounting only receives the minimal financial payload required to construct the journal entry, without exposing operational internals:

  1. Event Validation: Verify that the source event carries all required financial attributes (amount, currency, date, counterpart identifier).
  2. Account Mapping: Resolve the event type and business nature into the appropriate COA posting accounts using deterministic mapping rules.
  3. Cost Center Tagging: Attach analytical dimensions when provided by the source context.
  4. Journal Construction: Build a balanced journal voucher and route it through the standard posting workflow.
  5. Failure Handling: If a consumed event cannot be translated into a valid journal entry, it is quarantined for manual review rather than posted with errors.

3. Integration Contracts

Outbound Contract

Downstream contexts subscribing to Accounting events can rely on the following guarantees:

  • JournalEntryPosted is emitted only after the entry is durably committed to the ledger.
  • FiscalPeriodClosed is emitted only after the period lock is fully enforced.
  • All monetary values are expressed in both transaction currency and functional currency.

Inbound Contract

Operational contexts publishing events to Accounting must provide:

  • A unique document reference.
  • A transaction timestamp.
  • Amount and currency.
  • A morph alias pointing back to the originating document.
  • Optional analytical tags (cost center, project, department).

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