Life ConnectLife Connect
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
  • Cross-cutting concepts

    • EventBridge fanout
    • Atlas Triggers
    • ECS Fargate deploy lifecycle
    • Keycloak hosting
    • Cloudflare Pages auto-deploy
    • Bitbucket Pipelines (legacy)
    • Terraform-managed envs (legacy)
  • Accounting model

    • Accounting model
    • Events catalog
    • Accounting journals
    • Plan of accounts (PCG)
    • Auxiliary accounts
    • FEC fields (Fichier des Écritures Comptables)
    • pieceReference numbering
    • Tenant matrix (payable / receivable)
    • Owner matrix (payable / receivable)
    • Take-over UI display rules
Last updated 2026-05-04

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

ItemValue
Canonical event registryAccountingEventType enum — 67 constants
Posting matrix in codePostingRuleFactory — static factory per event family
Owning serviceadb-accounting
Plan of accountsFrench PCG (411xxx tenants, 401xxx suppliers, 466100 owners, 706xxx products, 165xxx deposits, 800000 off-balance)
Journals13, see journals.md
Compliance targetFrench FEC (Fichier des Écritures Comptables) — 19 fields, see fec.md
Original source of truthGoogle Sheet 'Event Matrix Accounting'

Map of this section

  • Events catalog — sortable index of every AccountingEventType constant 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-xxx prefix 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:

  1. Business case — verbatim French quote from the sheet, plus an English gloss.
  2. At a glance — family, journal, recurrent flag, manual flag, status, pieceReference chrono.
  3. Accounting entry — debit and credit accounts.
  4. 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.
  5. Confluence — link to the legacy spec page if one exists.
  6. Open questions — flags status En cours / À analyser events 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).

ScriptPurposeWhen to run
generate-event-pages.jsRegenerates one <event>.md per row in events/_events.json. Preserves any existing Code references block.After editing _events.json.
sync-accounting-events.jsRefreshes 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 the pieceReference tab — flagged on piece-reference.md. The intended chrono format for the affected events is unclear.
  • The auxiliary-account naming for RC-xxxxx is ambiguous between "tenant rental contract" (used everywhere else) and "supplier" (one row in the sheet). See auxiliary-accounts.md.
  • A handful of enum constants (OUTGOING_PAYMENT, OWNER_ADJUSTMENT, TRANSFER_BALANCE_SHEET) have no Java call sites today. They appear in catalog .properties files and may be referenced through reflection or the catalog system. Worth confirming with the engineer.
Edit this page
Last Updated:
Contributors: Yevhenii Khudolii
Next
Events catalog