LedgerOS · Phase 5 · Production Integration Blueprint

Data Model & Lineage Map

Every mock object mapped to a Postgres entity. Every displayed number disclosed to its source, transformation, and confidence.

LedgerOS UI Design Lab · Phase 5 blueprint — no backend is connected. Every endpoint, permission, and event listed here is a design contract, not a live API.
Mock ObjectFileEntityKey columnsStorage
INVOICESsrc/lib/mock/invoicing.tsinvoicesid, customer_id, status, issued_at, due_at, total, treatmentIn Postgres
INVOICE_LINESsrc/lib/mock/invoicing.tsinvoice_linesid, invoice_id, service_id, qty, rate, treatment, department, stateIn Postgres
CUSTOMERSsrc/lib/mock/invoicing.tscustomersid, name, billing_profile, portal_statusIn Postgres
ESTIMATES / RECURRING / CREDIT_NOTESsrc/lib/mock/invoicing.tsestimates, recurring_schedules, credit_notesid, invoice_id, schedule, applied_atExtend schema
EXPENSESsrc/lib/mock/expenses.tsexpensesid, vendor_id, amount, status, policy_result, matched_txn_idIn Postgres
RECEIPTSsrc/lib/mock/expenses.tsreceiptsid, source, ocr_confidence, matched_expense_idNew table
SUBSCRIPTIONSsrc/lib/mock/expenses.tssubscriptionsid, vendor_id, cadence, next_charge, healthNew table
POLICIESsrc/lib/mock/expenses.tspolicy_rulesid, trigger, condition_json, action, approval, effective_atNew table
PRE_SPEND_REQUESTSsrc/lib/mock/expenses.tspre_spend_requestsid, requester, amount, projected_impact, statusNew table
ALLOCATIONSsrc/lib/mock/cash-availability.tsallocationsid, source_txn_id, invoice_id, bucket, amount, treatment, rule_idNew table
TREATMENT_RULESsrc/lib/mock/cash-availability.tsallocation_rulesid, service_id, treatment, split_json, effective_atNew table
GUARDRAILSsrc/lib/mock/automation.tsguardrailsid, metric, threshold, action, override_stateNew table
AUTOMATION_RULESsrc/lib/mock/automation.tsautomation_rulesid, trigger, condition_json, action, approval, ownerNew table
APPROVALSsrc/lib/mock/automation.tsapproval_tasksid, source_type, source_id, approver, statusNew table
EXCEPTIONSsrc/lib/mock/automation.tsexceptionsid, source, severity, opened_at, resolved_atNew table
DECISION_LOGsrc/lib/mock/automation.tsdecision_logid, decision_type, actor, before, after, justification, timestampNew table
LEAKAGE_OPPSsrc/lib/mock/intelligence.tsleakage_opportunitiesid, source, amount, confidence, statusNew table
FORECAST_SCENARIOSsrc/lib/mock/intelligence.tsforecast_scenariosid, key, assumptions_json, horizonNew table
RECOMMENDATIONSsrc/lib/mock/intelligence.tsrecommendationsid, category, impact, evidence_refs, statusNew table
AUDIT_EVENTSsystem-wideaudit_eventsid, actor, target_type, target_id, action, before, after, tsExtend schema

Number lineage

Every high-stakes figure surfaced in LedgerOS must disclose its lineage in-context.

True available cash
Source: Cash Availability engine
Inputs: Bank balances · Pass-through obligations · Commission reserves · Payroll accrual
Confidence: High · reconciled hourly
Marketing ROI
Source: Attribution + GL
Inputs: Ad spend (per campaign) · Attributed revenue (per client) · Contribution margin
Confidence: Medium · attribution model dependent
Bonus obligation
Source: Bonus engine
Inputs: Invoice paid · Commission plan · Verification · Approval
Confidence: High post-verification
Technology ROI
Source: Tech portfolio
Inputs: Provider invoice · Usage telemetry · Attributed revenue · Adoption
Confidence: Medium
Client profitability
Source: Profitability engine
Inputs: Revenue · COGS · Attributed marketing · Support · Overhead allocation
Confidence: Medium
Revenue leakage
Source: Leakage engine
Inputs: Reimbursable expenses · Untracked hours · Milestone completion · Contract terms
Confidence: Medium — must be verified before invoicing
Financial Confidence Score
Source: Confidence engine
Inputs: 13 signals · data freshness · reconciliation gap · approval coverage
Confidence: High for score, low for individual signals
Forecasts
Source: Forecasting engine
Inputs: Historical actuals · Booked pipeline · Scenario assumptions
Confidence: Scenario-dependent — always shown with range