-
Notifications
You must be signed in to change notification settings - Fork 0
Data Model
eugnmueller-87 edited this page Jun 24, 2026
·
1 revision
Canonical source: the ordered migration chain in
db/migrations/,
run via dbmate.
db/schema.sql is a generated snapshot — never hand-edited (see
Design-Decisions ADR-007).
| Domain | Tables |
|---|---|
| Organization |
branches · cost_centers · users
|
| Suppliers |
suppliers · legal_documents · compliance_checks
|
| Contracts |
contracts · contract_changes · contract_clauses
|
| Budget |
budget_buckets · budget_positions · budget_pools · budget_reallocations
|
| P2I |
purchase_orders · po_sequences · invoices · payment_instructions · erp_sync_queue
|
| Assets |
assets · asset_depreciation_log
|
| Licenses |
license_entitlements · license_assignments
|
| Consumption |
hyperscaler_positions · llm_api_keys · llm_consumption
|
| Operations |
tickets · decisions · trace_log · supplier_emails
|
| Intelligence |
vendor_pricing_benchmarks · trust_settings
|
open_tickets_board · purchase_orders_board · catalog_by_supplier ·
contracts_expiring · po_analytics · invoice_analytics · spend_trend ·
savings_tracking · supplier_performance · approval_velocity
CFO sets annual plan (budget_buckets)
↓ Controlling approves → distributed to cost centers
Every PO approved → budget_positions.committed += amount (immediate)
Every invoice paid → committed released, spent incremented
↓
Pool reserve (budget_pools) — CFO lever, drawn by exception only
↓
Every move → budget_reallocations (immutable audit trail)
Three-tier approval check on every request:
-
Category bucket —
branch × category × quarterheadroom? - Branch annual — running above 80% YTD?
-
Manager authority — within
users.spend_authorityfor this category?
Full column-level detail lives in docs/data-model.md in the repo.
TrueSpend — AI-native procurement OS · Repository · Built by Eugen Müller · Wiki maintained from the repo docs/
Overview
Deep dives