ERP Core / Accounting

Accounting - Domain Events & Integration Contracts

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

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 (13 Core Domain Events)

Domain EventTriggering ConditionKey Payload AttributesPrimary Consumers
JournalEntryCreatedA new journal voucher draft is saved.VoucherNumber, EntryDate, Currency, DraftTotal, ActorIDAudit Trail, Notification Services
JournalEntrySubmittedA draft passes zero-sum validation and enters pending approval.VoucherNumber, TotalDebit, TotalCredit, Currency, MakerIDApproval Inbox, Notification Service
JournalEntryApprovedAn independent checker approves a submitted voucher.VoucherNumber, ApprovalTimestamp, MakerID, ApproverIDWorkflow Dispatcher, Auto-Poster
JournalEntryRejectedAn approver rejects a voucher with mandatory reason.VoucherNumber, RejectionReason, ApproverIDMaker Notification, Alert Queue
JournalEntryPostedA journal voucher is successfully committed to the General Ledger.VoucherNumber, PostingDate, Debits, Credits, FunctionalAmounts, SourceRefReporting Engine, Subledgers, Real-Time Dashboards
JournalEntryReversedA posted voucher is neutralized by an offsetting Storno reversal.OriginalVoucherNumber, ReversalVoucherNumber, Reason, ActorIDAudit Log, Subledger Reconcilers
FiscalPeriodClosedAn accounting period is soft-closed or hard-locked.PeriodCode, FiscalYear, LockType, ActorIDTax Engine, Period Lock Monitors
FiscalPeriodReopenedA closed fiscal period is administratively reopened.PeriodCode, JustificationReason, AuthorizedActorIDForensic Audit, Compliance Monitor
FiscalYearClosedFiscal year is closed, nominal accounts zeroed, equity rolled over.FiscalYear, NetIncomeSummary, RetainedEarningsAccount, ActorIDFinancial Statement Archive, Tax Reporting
AccountBalanceThresholdBreachedAn account running balance crosses a configured risk threshold.AccountCode, CurrentBalance, ThresholdAmount, CurrencyTreasury, Cash Flow Monitor, Alerting
CurrencyCreatedA new ISO 4217 currency is registered in the master catalog.CurrencyCode, Name, Symbol, PrecisionBilling Context, Pricing, Cash Management
ExchangeRateUpdatedA daily exchange rate snapshot is recorded or refreshed.CurrencyCode, Rate, InverseRate, EffectiveDate, SourceInvoicing, Subledgers, Revaluation Service
BaseCurrencyChangedThe enterprise base reporting currency is switched.PreviousBaseCurrency, NewBaseCurrency, EffectiveDate, ActorIDForensic Audit Trail, Financial Consolidation

Event Payload Characteristics

Emitted events contain only ledger-relevant facts:

  • Voucher reference and posting timestamp.
  • Total debit and credit amounts per currency.
  • Source document reference and originating context 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 source reference 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