ERP Core / Accounting

Accounting - Bounded Context & System Boundaries

Define the operational scope, boundaries, and anti-corruption layer for the Accounting & Financial Management domain.

The Accounting & Financial Management System (FMS) operates as the authoritative bounded context for recording, classifying, summarizing, and reporting the financial consequences of every economic event across the Obelaw ecosystem.

By maintaining strict boundaries, the domain protects the integrity of the General Ledger and ensures that financial statements remain auditable, immutable, and regulatorily sound.


1. Operational Scope

The Accounting & Financial Management System (FMS) operates as a headless bounded context decoupled from operational presentation. The domain is strictly responsible for the financial interpretation and statutory governance of enterprise activity across nine core functional pillars:

  1. Chart of Accounts (COA) Governance: Hierarchical taxonomy (Root Class, Main Group, Sub-Group, Leaf Posting), leaf-only posting validation, and real-time running balance aggregation.
  2. Journal Voucher Processing: Transactional drafting, mathematical zero-sum verification, Maker-Checker segregation, General Ledger posting, and Storno reversal workflows.
  3. General Ledger: The immutable book of final entry, individual account ledgers, Trial Balance parity, Balance Sheet, and Income Statement (P&L) generation.
  4. Fiscal Calendar & Period Governance: Fiscal years, monthly and quarterly periods, soft and hard period locks, and temporal posting cutoffs.
  5. Analytical Cost Centers: Multi-dimensional analytical tagging (Cost Centers, Projects, Departments) providing financial segment reporting without inflating primary account codes.
  6. Fiscal Year-End Closing: Nominal revenue and expense account zeroing and Retained Earnings equity rollover.
  7. Forensic Audit Trail: Append-only compliance log recording every state mutation, actor identity, timestamp, and pre/post entity states.
  8. Anti-Corruption Layer (ACL): Ingestion engine translating external operational events into balanced journal vouchers without database coupling.
  9. Multi-Currency & Foreign Exchange: ISO 4217 currency registry, daily exchange rate snapshots, cross-rate triangulation, and integer minor unit conversions.

2. Out-of-Scope Boundaries

To preserve domain purity and prevent architectural coupling, the Accounting context explicitly does not manage the following concerns:

Out-of-Scope ConcernCorrect Ownership
Physical cash drawer hardware and till operationsPOS / Retail Operations
Customer invoice issuance, payment chasing, and debt collection workflowsCRM / Receivables Management
Physical warehouse valuation, lot costing, and stock movementsInventory / Supply Chain
Supplier negotiation, purchase orders, and procurement approvalPurchasing / Procurement
Payroll computation, tax withholding, and employee benefitsHCM / Payroll

Accounting may consume events from these contexts, but it never owns their workflows.


3. Context Mapping & Integration Relationships

The Accounting & FMS Bounded Context interacts with external contexts using explicit, formal DDD relationship patterns. This ensures that operational changes do not corrupt internal ledger logic.

Integrating ContextRelationship TypeInteraction PatternBusiness Purpose
Sales / Billing ContextUpstream (Sales) to Downstream (FMS)Customer-SupplierFMS reacts to InvoiceCreated and revenue-recognition events to record receivables and revenue.
Purchasing / Procurement ContextUpstream (Purchasing) to Downstream (FMS)Customer-SupplierFMS reacts to approved bills and supplier liabilities to record expenses and payables.
POS / Retail Operations ContextUpstream (POS) to Downstream (FMS)Customer-SupplierFMS reacts to CashOnDeliveryCollected and till-settlement events to record cash and revenue.
Inventory / WMS ContextUpstream (Inventory) to Downstream (FMS)Customer-SupplierFMS reacts to consumption, receiving, and valuation events to record asset and COGS movements.
Foreign Exchange (FX) FeedsExternal Service to FMSConformist / AdapterIngestion of daily exchange rates from central banks or commercial market data feeds.

4. Domain Isolation & Anti-Corruption Layer (ACL)

Accounting acts as an asynchronous subscriber to operational events. Operational domains publish business events such as InvoiceIssued, GoodsReceived, or CashCollected. Accounting listens to these events and translates them into balanced journal entries through a dedicated Anti-Corruption Layer (ACL).

Zero Direct Database Mappings

  • No Shared Foreign Keys: The Accounting context contains no foreign keys pointing directly to sales orders, purchase orders, inventory lots, or customer records.
  • Polymorphic Reference Mappings: Relationships to external documents are linked using generic reference fields (Source Type and Source Reference). This links a journal voucher to a SalesOrder, PurchaseOrder, or ProductionTicket without database-level coupling.

The Anti-Corruption Layer (ACL) Translation Engine

The ACL acts as a unidirectional translator on the context boundary. It validates, translates, and maps operational event payloads into ledger-aware instructions:

  1. Inbound Translation (Operational Event → Ledger Instruction): Translates external document identifiers and event metadata into debit/credit account allocations, cost center tags, and source references.
  2. Payload Isolation: The ACL forwards only the minimal financial payload required to construct a journal entry. Operational internals such as product categories, carrier details, or customer loyalty tiers are never exposed to Accounting.
  3. Event Replay Safety: Because Accounting rebuilds ledger state from posted journal entries rather than operational snapshots, historical events can be replayed through the ACL without corrupting current balances.

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