Canonical Domain Model
Canonical case-study proposal. The Shared Data Model describes the same selected storage choice. No production schema is implemented.
The key distinction
A voucher line, a general-ledger balance, a supplier invoice, and a tax-statement record may share dates and amounts, but they are not the same entity. Keeping them distinct avoids misleading reconciliation logic.
Required entities and ownership
| Entity / aggregate | Primary fields or relationships | Owner |
|---|---|---|
firm, user, membership | Global user identity; firm ID, roles, membership status | Identity/tenancy |
client | Firm ID, legal-entity name, jurisdictional identifiers | Engagement |
engagement | Firm/client IDs, engagement type, period start/end, framework, jurisdiction, revision, status | Engagement |
procedure / risk_assessment | Objective, assertion/risk, required source, preparer, reviewer, completion state | Planning |
source_file_version | Firm/engagement, source system, hash, uploader, immutable object key, supersedes | Ingestion |
dataset_snapshot | Source-version references, scope, parser version, counts and checksum | Ingestion |
journal_entry and journal_line | Voucher ID, posting date, account, party (if known), debit/credit, source-row link | Accounting adapter |
account, trial_balance | Raw name, taxonomy, balance period, currency and source scope | Normalization |
supplier_invoice, tax_statement_record | Source IDs, invoice reference, counterparty, amount, taxes, amendments | Jurisdiction adapters |
reconciliation | Control source, expected/actual counts and totals, reviewer, exceptions, status | Reconciliation |
jurisdiction_pack | Jurisdiction, approved version, effective window, rules, hash | Governance |
rule_run, check_result | Snapshot, pack/config/code version, applicability, coverage status, diagnostics | Rule execution |
finding / workpaper | Original severity, source refs, investigation state, notes, supporting evidence | Checks/workpapers |
approval / audit_event | Actor, revision, approval scope, immutable sequence and reason | Review/evidence |
outbox_event | Event ID, aggregate ID, type/version, payload ref, commit timestamp, delivery state | Platform |
Foreign-key and isolation rule: every firm-private record must be associated unambiguously with a firm and engagement or with a trusted internal join. Test object access using both authenticated firm membership and engagement assignment.
Precision and provenance
- Monetary amounts use decimal fixed precision, original currency and explicit rounding/conversion records; never binary floating point for statutory thresholds.
- Store full original row/voucher IDs and source hash; don't invent missing dates, parties, agreements or legal classifications.
- Track source dataset coverage separately from parser correctness.
- Client legal entities and reporting frameworks may span jurisdictions; don't infer applicability from the firm's billing country.
- Treat
findingas a review candidate andworkpaper/procedureas the auditor's documented work; do not infer audit completeness from finding counts. - The snapshot and rule output are immutable; human dispositions are versioned and attributable.
Required invariants
- A rule cannot claim
COMPLETEDwithout its declared input prerequisites and applicability decision. - A source can be
PARSEDyetINCOMPLETEfor the intended audit population. - Reuploads create a new source version and invalidate dependent assessments; the old evidence remains accessible.
- A finding can recur after a rerun; older notes are preserved without silently approving the new result.
- Sign-off refers to an immutable current engagement revision and required procedure coverage.
- Audit events and outbox events are committed transactionally with each domain mutation.
The earlier transaction table remains a candidate staging representation, not a universal authoritative financial-record type.
See Source Story, System Architecture, and Review Contract.