Update documentation to align terminology, clarify project stages, and improve consistency; add RECOMMENDATIONS.md for project-specific guidance.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
---
|
||||
**Last Updated:** 2025-01-17
|
||||
**Phase:** Phase 0 (Planning)
|
||||
**Status:** Approved
|
||||
**Status:** Draft
|
||||
**Owner:** Backend Architect
|
||||
**References:**
|
||||
- `/docs/project-overview.md`
|
||||
|
||||
Reference in New Issue
Block a user