Entity-relationship overview supporting every screen in the prototype. Money fields are stored as integer JPY (_jpy); balances are always derived, never stored. The ledger is append-only — corrections are new rows, not edits.
Yen type at the type-layer prevents float arithmetic.invoices.total_jpy == Σ(invoice_lines) + tax_jpy — runtime check on write.Σ(invoices.total) − Σ(payments.amount). Never stored.rule_executions unique on (customer_id, rule_id, billing_period) — a rule cannot fire twice per cycle.processing_runs.run_date is unique — daily processing can only be attempted once per calendar day.audit_log is append-only — no UPDATE or DELETE grant in production.