This service owns the storage abstraction layer for the platform.
mysql50 — compatibility adapter for the existing legacy MySQL 5.0 schema.postgres — migration-ready target backend (planned).sqlite — local test/dev adapter (planned).cd services/database-abstraction-core
uv sync
Start this service only through the automation stack:
uv run --with fastapi==0.115.14 --with uvicorn==0.37.0 --with pydantic==2.11.7 --with starlette==0.46.0 python scripts/automation.py up --start-stack
For local secrets such as STATS_DB_PASSWORD_CAPETOWN, a repo-root .env file is loaded automatically by the automation launcher and by the local database_abstraction_core.main entrypoint. Existing exported environment variables are preserved and take precedence.
Health check:
GET /healthReadiness:
GET /readyBackend selection and diagnostics:
GET /backendsGET /statistics/configuration?company=<company>GET /cashier/configuration?company=<company>GET /automatedmail/configuration?company=<company>Statistics adapter endpoints:
POST /statistics/authenticate (company optional in payload)GET /statistics/userreports?limit=500&company=<company>POST /statistics/reports/daily-comm-salesPOST /statistics/reports/daily-mass-salesPOST /statistics/reports/commodity-summaryGET /statistics/company-mapPOST /statistics/company-mapPOST /statistics/company-map/test-connection (validates host/user/password and lists visible databases)Statistics report behavior:
Cashier adapter endpoints:
POST /cashier/authenticate (company optional in payload)POST /cashier/session-bootstrapGET /cashier/session-summary?company=<company>&session_id=<session_id>GET /cashier/session-read-model?company=<company>&session_id=<session_id>POST /cashier/day-end-previewPOST /cashier/day-end-executeGET /cashier/company-mapPOST /cashier/company-mapPOST /cashier/company-map/test-connection (validates host/user/password and lists visible databases)Automated mail adapter endpoints:
GET /automatedmail/configuration?company=<company>GET /automatedmail/company-mapPOST /automatedmail/company-mapPOST /automatedmail/company-map/test-connectionGET /automatedmail/queue?company=<company>&filter_text=<text>&limit=100GET /automatedmail/queue/<mail_id>?company=<company>POST /automatedmail/submitPOST /automatedmail/queue/<mail_id>/requeue?company=<company>DELETE /automatedmail/queue/<mail_id>?company=<company>Company-map durability:
services/database-abstraction-core/config/company-maps/stats-company-map.jsonservices/database-abstraction-core/config/company-maps/cashier-company-map.jsonservices/database-abstraction-core/config/company-maps/creditors-company-map.jsonservices/database-abstraction-core/config/company-maps/icapv-company-map.jsonservices/database-abstraction-core/config/company-maps/automatedmail-company-map.json.faas-state, so the initial live configuration does not depend on the admin workspace.services/database-abstraction-core/.faas-state/stats-company-map.jsonSTATS_DB_COMPANY_MAP_FILE=<absolute-or-relative-path>STATS_DB_COMPANY_MAP (env JSON) is still supported and overlays persisted values at runtime.database for the main statistics auth/report path, usually iimsstatsaux_database for levy and debtors-linked reporting, usually cfidebtorsmail_database for the legacy automated-mail queue path, usually automatedmailservices/database-abstraction-core/.faas-state/cashier-company-map.jsonCASHIER_DB_COMPANY_MAP_FILE=<absolute-or-relative-path>CASHIER_DB_COMPANY_MAP (env JSON) is still supported and overlays persisted values at runtime.services/database-abstraction-core/.faas-state/creditors-company-map.jsonCREDITORS_DB_COMPANY_MAP_FILE=<absolute-or-relative-path>CREDITORS_DB_COMPANY_MAP (env JSON) is still supported and overlays persisted values at runtime.services/database-abstraction-core/.faas-state/icapv-company-map.jsonICAPV_DB_COMPANY_MAP_FILE=<absolute-or-relative-path>ICAPV_DB_COMPANY_MAP (env JSON) is still supported and overlays persisted values at runtime.services/database-abstraction-core/.faas-state/automatedmail-company-map.jsonAUTOMATEDMAIL_DB_COMPANY_MAP_FILE=<absolute-or-relative-path>AUTOMATEDMAIL_DB_COMPANY_MAP (env JSON) is still supported and overlays persisted values at runtime.remote account and uses STATS_DB_PASSWORD_CAPETOWN as the baseline secret reference. Runtime overrides can still move any app onto a different env var later.See documentation/operations/database-migration.md for staged migration strategy from legacy MySQL 5.0 to pluggable backends.