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 Event | Triggering Condition | Key Payload Attributes | Primary Consumers |
|---|---|---|---|
JournalEntryCreated | A new journal voucher draft is saved. | VoucherNumber, EntryDate, Currency, DraftTotal, ActorID | Audit Trail, Notification Services |
JournalEntrySubmitted | A draft passes zero-sum validation and enters pending approval. | VoucherNumber, TotalDebit, TotalCredit, Currency, MakerID | Approval Inbox, Notification Service |
JournalEntryApproved | An independent checker approves a submitted voucher. | VoucherNumber, ApprovalTimestamp, MakerID, ApproverID | Workflow Dispatcher, Auto-Poster |
JournalEntryRejected | An approver rejects a voucher with mandatory reason. | VoucherNumber, RejectionReason, ApproverID | Maker Notification, Alert Queue |
JournalEntryPosted | A journal voucher is successfully committed to the General Ledger. | VoucherNumber, PostingDate, Debits, Credits, FunctionalAmounts, SourceRef | Reporting Engine, Subledgers, Real-Time Dashboards |
JournalEntryReversed | A posted voucher is neutralized by an offsetting Storno reversal. | OriginalVoucherNumber, ReversalVoucherNumber, Reason, ActorID | Audit Log, Subledger Reconcilers |
FiscalPeriodClosed | An accounting period is soft-closed or hard-locked. | PeriodCode, FiscalYear, LockType, ActorID | Tax Engine, Period Lock Monitors |
FiscalPeriodReopened | A closed fiscal period is administratively reopened. | PeriodCode, JustificationReason, AuthorizedActorID | Forensic Audit, Compliance Monitor |
FiscalYearClosed | Fiscal year is closed, nominal accounts zeroed, equity rolled over. | FiscalYear, NetIncomeSummary, RetainedEarningsAccount, ActorID | Financial Statement Archive, Tax Reporting |
AccountBalanceThresholdBreached | An account running balance crosses a configured risk threshold. | AccountCode, CurrentBalance, ThresholdAmount, Currency | Treasury, Cash Flow Monitor, Alerting |
CurrencyCreated | A new ISO 4217 currency is registered in the master catalog. | CurrencyCode, Name, Symbol, Precision | Billing Context, Pricing, Cash Management |
ExchangeRateUpdated | A daily exchange rate snapshot is recorded or refreshed. | CurrencyCode, Rate, InverseRate, EffectiveDate, Source | Invoicing, Subledgers, Revaluation Service |
BaseCurrencyChanged | The enterprise base reporting currency is switched. | PreviousBaseCurrency, NewBaseCurrency, EffectiveDate, ActorID | Forensic 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 Event | Source Context | Accounting Action |
|---|---|---|
| InvoiceCreated | Sales / Billing | Record revenue and receivables. |
| CashOnDeliveryCollected | POS / Delivery | Record cash increase and revenue realization. |
| RawMaterialsConsumed | Inventory / Manufacturing | Record work-in-process or cost of goods sold. |
| PaymentReceived | Receivables | Reduce receivables and increase cash/bank. |
| BillApproved | Purchasing | Record 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:
- Event Validation: Verify that the source event carries all required financial attributes (amount, currency, date, counterpart identifier).
- Account Mapping: Resolve the event type and business nature into the appropriate COA posting accounts using deterministic mapping rules.
- Cost Center Tagging: Attach analytical dimensions when provided by the source context.
- Journal Construction: Build a balanced journal voucher and route it through the standard posting workflow.
- 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:
JournalEntryPostedis emitted only after the entry is durably committed to the ledger.FiscalPeriodClosedis 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).