Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs. Co-authored-by: Cursor <cursoragent@cursor.com>
1.3 KiB
1.3 KiB
Service Architecture
Internal Layering (every backend service)
API (routers) → Services (business logic) → Repositories → Models (DB)
↑
Schemas (Pydantic DTOs)
| Layer | Allowed | Forbidden |
|---|---|---|
| API / Views | Auth deps, validation, HTTP mapping | Business rules, raw SQL |
| Services | Domain logic, orchestration, events | HTTP concerns, UI |
| Repositories | Queries/persistence | Business decisions |
| Models | Schema mapping | Business workflows |
Core Package Layout
core/— config, database, cache, security, loggingmiddlewares/— tenant resolutionworkers/— Celery tasks (outbox, SSL provision, …)api/v1/— versioned routerstests/— automated tests
Adding a Service
- New folder under
backend/services/<name>/ - Independent database + Alembic
- Register in Core service/module registry
- Document in module-registry.md
- UI only in
frontend/, API-only access - Follow coding-standards.md