Skip to main content

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 / aggregatePrimary fields or relationshipsOwner
firm, user, membershipGlobal user identity; firm ID, roles, membership statusIdentity/tenancy
clientFirm ID, legal-entity name, jurisdictional identifiersEngagement
engagementFirm/client IDs, engagement type, period start/end, framework, jurisdiction, revision, statusEngagement
procedure / risk_assessmentObjective, assertion/risk, required source, preparer, reviewer, completion statePlanning
source_file_versionFirm/engagement, source system, hash, uploader, immutable object key, supersedesIngestion
dataset_snapshotSource-version references, scope, parser version, counts and checksumIngestion
journal_entry and journal_lineVoucher ID, posting date, account, party (if known), debit/credit, source-row linkAccounting adapter
account, trial_balanceRaw name, taxonomy, balance period, currency and source scopeNormalization
supplier_invoice, tax_statement_recordSource IDs, invoice reference, counterparty, amount, taxes, amendmentsJurisdiction adapters
reconciliationControl source, expected/actual counts and totals, reviewer, exceptions, statusReconciliation
jurisdiction_packJurisdiction, approved version, effective window, rules, hashGovernance
rule_run, check_resultSnapshot, pack/config/code version, applicability, coverage status, diagnosticsRule execution
finding / workpaperOriginal severity, source refs, investigation state, notes, supporting evidenceChecks/workpapers
approval / audit_eventActor, revision, approval scope, immutable sequence and reasonReview/evidence
outbox_eventEvent ID, aggregate ID, type/version, payload ref, commit timestamp, delivery statePlatform

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 finding as a review candidate and workpaper/procedure as 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​

  1. A rule cannot claim COMPLETED without its declared input prerequisites and applicability decision.
  2. A source can be PARSED yet INCOMPLETE for the intended audit population.
  3. Reuploads create a new source version and invalidate dependent assessments; the old evidence remains accessible.
  4. A finding can recur after a rerun; older notes are preserved without silently approving the new result.
  5. Sign-off refers to an immutable current engagement revision and required procedure coverage.
  6. 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.