Architecture
19 sept 2025 authored floris
General architecture

11000 - bank account 1
11001 - bank account 2
110010 - bank account 11
110011
Keep the 00
vat deductable=bool
Transaction Lifecycle
Transaction (tx) lifecycle

Debit / Credit Posting Flow (with Country/CoA Context)

-
transactions→ raw banking transactions -
documents_v2→ receipts, invoices, supporting docs -
reconciliations→ links transactions ↔ documents -
v_banking_accounts→ unified banking view -
gl_accounts→ CoA scoped bycountry_code,coa_provider,coa_version -
gl_rules→ JSON-based conditions map transactions to GL accounts -
journal_entries→ headers for postings (per transaction or doc) -
journal_lines→ debit/credit details -
gl_log→ operational log from posting functions (POSTED,RULE_NOT_FOUND) -
gl_audit_log→ immutable change capture via triggers ongl_accounts,gl_rules,journal_entries,journal_lines -
post_transaction_to_gl()→ posts one transaction into GL -
post_unposted_transactions()→ batch posts all unposted company transactions -
v_gl_full_audit→ joins transactions, documents, reconciliations, journals, and logs for full visibility
this design will allow a parallel charts of accounts (e.g. RGS 3.7 NL, RGS 3.8 NL, IFRS BE) switch providers/versions without losing history
Systems overview

ERD

Reporting view
