Accounting model
AI-generated content
This document was generated by an AI assistant from the 'Event Matrix Accounting' Google Sheet (owner mickael.bouly@life-connect.fr, last touched 2024-12-23) and from the canonical AccountingEventType Java enum. Verify accuracy before relying on the details.
ADB models accounting as a stream of typed events (call for rent, payment received, supplier invoice, take-over balance, …). Each event maps to a deterministic pair of debit/credit ledger entries posted to a French PCG account, on one of 13 named journals. This page is the entry point to that model. It mirrors the 'Event Matrix Accounting' Google Sheet but lives in source control so it diffs cleanly with code changes and is reachable by AI agents reading the repo.
For AI agents
If you need to reason about an accounting flow, start at events/index.md and drill into the specific events/<event>.md. Every event page has a Code references section that lists the exact Java files (with line numbers) where the event is defined and used — refresh that section with npm run sync:accounting-events from adb-doc/. Never invent a new event without first updating events/_events.json and re-running the generator.
At a glance
| Item | Value |
|---|---|
| Canonical event registry | AccountingEventType enum — 67 constants |
| Posting matrix in code | PostingRuleFactory — static factory per event family |
| Owning service | adb-accounting |
| Plan of accounts | French PCG (411xxx tenants, 401xxx suppliers, 466100 owners, 706xxx products, 165xxx deposits, 800000 off-balance) |
| Journals | 13, see journals.md |
| Compliance target | French FEC (Fichier des Écritures Comptables) — 19 fields, see fec.md |
| Original source of truth | Google Sheet 'Event Matrix Accounting' |
Map of this section
- Events catalog — sortable index of every
AccountingEventTypeconstant with its journal, debit/credit pair, business case and live call sites. - Journals — the 13 named accounting journals.
- Plan of accounts — ~70 PCG ledger accounts with French and English labels.
- Auxiliary accounts —
RC-xxxxx,SUP-xxx,RDC-xxxprefix conventions. - FEC fields — the 19 French regulatory fields and which are mandatory.
- pieceReference numbering — chrono prefixes (
CF…,INV…,ITN…). - Matrices — full debit/credit table for tenant-side events and owner-side events.
- Take-over UI rules — display rules for the 5
ACCOUNTING_TAKEOVER_*events.
How to read an event page
Every event page follows the same shape:
- Business case — verbatim French quote from the sheet, plus an English gloss.
- At a glance — family, journal, recurrent flag, manual flag, status,
pieceReferencechrono. - Accounting entry — debit and credit accounts.
- Code references — auto-generated. Lists the enum definition site and every live call site in the monorepo, grouped by service. Regenerated by
node adb-doc/scripts/sync-accounting-events.js. - Confluence — link to the legacy spec page if one exists.
- Open questions — flags status
En cours/À analyserevents and any other discrepancy worth raising.
Maintenance workflow
Two scripts back this section. Both live in adb-doc/scripts/ and use plain JS (no TypeScript, per repo convention).
| Script | Purpose | When to run |
|---|---|---|
generate-event-pages.js | Regenerates one <event>.md per row in events/_events.json. Preserves any existing Code references block. | After editing _events.json. |
sync-accounting-events.js | Refreshes the Code references block in every event page from a live ripgrep over Java sources. | After any change to AccountingEventType or to a posting-rule call site. Available as npm run sync:accounting-events in adb-doc/. |
The sync script exits non-zero if any event in _events.json has zero call sites in the monorepo (with a small whitelist for known internal-only carriers). That's the early-warning signal for a typo or a removed enum constant.
Open questions
- The Google Sheet contains a small number of
#REF!cells in thepieceReferencetab — flagged onpiece-reference.md. The intended chrono format for the affected events is unclear. - The auxiliary-account naming for
RC-xxxxxis ambiguous between "tenant rental contract" (used everywhere else) and "supplier" (one row in the sheet). Seeauxiliary-accounts.md. - A handful of enum constants (
OUTGOING_PAYMENT,OWNER_ADJUSTMENT,TRANSFER_BALANCE_SHEET) have no Java call sites today. They appear in catalog.propertiesfiles and may be referenced through reflection or the catalog system. Worth confirming with the engineer.