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
INVOICES
src/lib/mock/invoicing.tsinvoicesid, customer_id, status, issued_at, due_at, total, treatmentIn PostgresINVOICE_LINES
src/lib/mock/invoicing.tsinvoice_linesid, invoice_id, service_id, qty, rate, treatment, department, stateIn PostgresCUSTOMERS
src/lib/mock/invoicing.tscustomersid, name, billing_profile, portal_statusIn PostgresESTIMATES / RECURRING / CREDIT_NOTES
src/lib/mock/invoicing.tsestimates, recurring_schedules, credit_notesid, invoice_id, schedule, applied_atExtend schemaEXPENSES
src/lib/mock/expenses.tsexpensesid, vendor_id, amount, status, policy_result, matched_txn_idIn PostgresRECEIPTS
src/lib/mock/expenses.tsreceiptsid, source, ocr_confidence, matched_expense_idNew tableSUBSCRIPTIONS
src/lib/mock/expenses.tssubscriptionsid, vendor_id, cadence, next_charge, healthNew tablePOLICIES
src/lib/mock/expenses.tspolicy_rulesid, trigger, condition_json, action, approval, effective_atNew tablePRE_SPEND_REQUESTS
src/lib/mock/expenses.tspre_spend_requestsid, requester, amount, projected_impact, statusNew tableALLOCATIONS
src/lib/mock/cash-availability.tsallocationsid, source_txn_id, invoice_id, bucket, amount, treatment, rule_idNew tableTREATMENT_RULES
src/lib/mock/cash-availability.tsallocation_rulesid, service_id, treatment, split_json, effective_atNew tableGUARDRAILS
src/lib/mock/automation.tsguardrailsid, metric, threshold, action, override_stateNew tableAUTOMATION_RULES
src/lib/mock/automation.tsautomation_rulesid, trigger, condition_json, action, approval, ownerNew tableAPPROVALS
src/lib/mock/automation.tsapproval_tasksid, source_type, source_id, approver, statusNew tableEXCEPTIONS
src/lib/mock/automation.tsexceptionsid, source, severity, opened_at, resolved_atNew tableDECISION_LOG
src/lib/mock/automation.tsdecision_logid, decision_type, actor, before, after, justification, timestampNew tableLEAKAGE_OPPS
src/lib/mock/intelligence.tsleakage_opportunitiesid, source, amount, confidence, statusNew tableFORECAST_SCENARIOS
src/lib/mock/intelligence.tsforecast_scenariosid, key, assumptions_json, horizonNew tableRECOMMENDATIONS
src/lib/mock/intelligence.tsrecommendationsid, category, impact, evidence_refs, statusNew tableAUDIT_EVENTS
system-wideaudit_eventsid, actor, target_type, target_id, action, before, after, tsExtend schemaNumber 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
