Credit — technical documentation index
Technical-layer documentation for the Ethica Capital Credit module — AAOIFI-compliant financing across three products: Murabaha (cost-plus sale), Ijarah (lease-to-own), and Diminishing Musharakah (declining co-ownership). Each page describes one area in engineering depth: models (fields, types, enums), endpoints, validation, the repayment math, design rationale, and edge cases.
Audience: engineers and future agents implementing or modifying the credit module.
Documentation rule. Like the finance module, each credit task ships with three docs: technical (here), architecture, and business. Do not duplicate content — cross-link.
Pages
| Doc | Covers |
|---|---|
| Data model | The six tables — facilities, assets, ownership ledger, schedule lines, payments, posting account-map |
| API | Endpoints under /credit — facility CRUD + lifecycle, payments, config, reports, and credit:* permissions |
| Engine | The declining-balance (DM/Ijarah) and fixed-profit (Murabaha) schedulers, with the worked golden example and the anti-riba pace-invariance guarantee |
Conventions
- File paths reference
ethica-api/andethica-erp/relative to the operations workspace root. - Money math: always
NUMERIC(20,4)in the DB +decimal.jsin code. Nevernumberfor money. - The credit module posts through the existing finance PostingEngine with
sourceModule = credit; all lines are taggedhalaland accounts resolve from the CFO account-map (never hardcoded, fail-closed if unmapped).
Related
- Credit architecture — lifecycle, posting flow, ownership wind-down diagrams.
- Credit operations guide — staff-facing walkthrough.
- Finance technical docs — the GL / posting engine credit builds on.