Finance OS
Schema foundation

Finance data model

The first implementation phase stores source lineage, canonical entities, aliases, and audit events before any calculation logic is introduced.

Baseline primitives
These tables are safe to build first because they do not encode payout/accounting assumptions.
TablePurposeClose risk
source_sync_runsTracks read-only connector runs, cursors, row counts, and failures.
low risk
raw_source_recordsStores source payload hashes so downstream finance numbers can be replayed and audited.
low risk
finance_entitiesDefines canonical finance identities before aliases and external IDs are approved.
low risk
finance_entity_aliasesMaps Rho, Drive, XLSX, Stripe, QBO, and Gravity names to finance entities with review state.
medium risk
external_identity_linksPreserves stable external IDs for source-system joins without relying on display names.
low risk
finance_audit_eventsAppend-only record of approvals, overrides, recalculations, and close locks.
low risk
month_close_periodsCoordinates close readiness, exception state, approval gates, and eventual lock metadata.
medium risk
finance_exceptionsCaptures source mismatches, missing approvals, alias conflicts, and reconciliation blockers.
medium risk
publisher_contractsTracks Drive-sourced publisher agreement documents and their reviewable contract state.
medium risk
publisher_contract_termsStores extracted publisher terms with human review state before payout calculations can consume them.
high risk
Next ledger layer
These should be added after source ingestion and alias review are stable.
advertiser_credit_grants
advertiser_funding_ledger
publisher_deposit_ledger
publisher_obligation_ledger
publisher_month_finance_facts