Update documentation to align terminology, clarify project stages, and improve consistency; add RECOMMENDATIONS.md for project-specific guidance.

This commit is contained in:
olekhondera
2025-12-12 01:50:38 +02:00
parent 8794e74934
commit 5053235e95
12 changed files with 102 additions and 43 deletions

View File

@@ -38,7 +38,7 @@
## 3. API Layers
- HTTP API (REST) with versioning (`/api/v1`).
- Service layer for business logic and transactions.
- Service layer for business logic and database transactions.
- Repositories for data access; use migrations for schema evolution.
## 4. Infrastructure & Ops
@@ -49,7 +49,7 @@
## 5. Data & Schema Notes
- Records: store raw payload + normalized fields + `reasoning_trace` JSONB (model, rationale, confidence, source).
- EventLog: include `source_agent` (default `balance`) and payload for auditability; ensure filters by tenant/time/type.
- Embeddings: table keyed by transaction/merchant strings to support similarity search; index with `pgvector`.
- Embeddings: table keyed by record text fields (or other domain signals) to support similarity search; index with `pgvector`.
- Multi-tenant: all core tables carry `tenantId` and enforce scoped queries; `User` role per tenant.
## 6. Payment & Messaging (High-Level)
@@ -59,5 +59,5 @@
## 7. Queues (BullMQ)
- `records:ingest` — normalize webhook payloads, write `Record`, emit `INGESTED`.
- `records:process` — rule engine → embeddings similarity → LLM fallback; emit `PROCESSED` with `reasoning_trace`.
- `reports:generate` — build P&L/exports, emit `REPORT_GENERATED`.
- `reports:generate` — build domain reports/exports, emit `REPORT_GENERATED`.
- Dead-letter queues per stream; retries with backoff; idempotent handlers keyed by external event IDs.