Skip to main content

Shared Data Model

This is the selected conceptual model. The detailed domain model and sign-off contract define invariants; no physical SQL schema has been implemented.

Global vs tenant-scoped entities​

ScopeEntitiesSecurity model
Global control planeuser, firm, firm_membership, session, proposed plan/subscriptionServer-verified identity and membership
Firm-private shared PostgreSQL tablesclient, engagement, source_file_version, dataset_snapshot, journal_entry, journal_line, finding, workpaper, audit_eventExplicit firm_id, application assignment checks plus RLS
Versioned object storageOriginal uploads, reviewer evidence, generated reports and exportsOwner firm/engagement, versioned keys, hashes, short-lived authorized access

The previous schema-per-tenant model is now a documented alternative, not the chosen pilot approach. See ADR-004.

Entity relationship diagram​

Core entity reference​

EntityImportant fields
engagementid, firm_id, client_id, period_start, period_end, jurisdiction, framework, revision, status
source_file_versionid, firm_id, engagement_id, source_system, content_hash, object_version, supersedes_id
dataset_snapshotid, firm_id, source_version_ids, parser_version, scope, accepted_count, rejected_count, reconciliation_status
journal_entry/lineentry_id, account_id, date, debit, credit, currency, source_ref
reconciliationdataset_id, expected_totals, actual_totals, reviewer_id, decision, evidence_ids
rule_run/check_resultsnapshot_id, pack_version, config_version, coverage_status, diagnostic, candidate_refs
finding/review_actionrule_result_id, original_severity, disposition, actor_id, evidence_ids
approvalengagement_revision, approver_id, evidence_manifest_id, decision, occurred_at
audit_event/outbox_eventevent_id, firm_id, aggregate_ref, revision, actor_id, payload_ref, committed_at

Tenant isolation model​

For the hypothetical pilot, use shared PostgreSQL tables with firm keys, RLS policies, application engagement-membership checks and a per-transaction server-verified tenant context. Do not rely solely on RLS, on X-Tenant-ID headers, or on guess-resistant resource IDs. The application role must not bypass RLS, and policies must be tested against cross-tenant joins and background jobs.

The design is not a certification or proof that the controls operate. See Security Design and Isolation Trade-offs.