GL & Booking Engine — Rules & Mapping Architecture
Single-source design document capturing the unified XRule taxonomy, versioned mapping layer, rule engine, and pluggable data/storage options (PostgresQL, Redis, RDI, Dragonfly, ScyllaDB)
0) TL;DR (high-level)
```mermaid
flowchart LR
subgraph Sources
T[Bank Txns\n(1.7M+)] -->|CSV/API| ING[Ingestor]
I[Invoices\n(400k+)] -->|CSV/API| ING
M[Manual Rules\n(User/Tenant)] -->|UI| CFG[Rule Config API]
end
subgraph Core
ING --> NORM[Normalizer]
NORM --> MAP[Mapping Layer\n(XRule Resolver)]
CFG --> MAP
MAP --> RE[Rule Engine]
RE --> BOOK[Booking Generator]
BOOK --> EV[Events/Audit Trail]
end
subgraph Data & Caches
PG[(Postgres)]
RD[(Redis/Dragonfly via RDI)]
SC[(ScyllaDB\noptional)]
end
MAP --- RD
RE --- RD
BOOK --- PG
EV --> PG
PG <--> RD
PG <--> SC
```