fix: Phase C IPSAS matrix (2100/2410 HO legs) and runtime double-entry guards
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m16s
CI/CD Pipeline / Security Scanning (push) Successful in 2m39s
CI/CD Pipeline / Lint and Format (push) Failing after 50s
CI/CD Pipeline / Terraform Validation (push) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 30s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 29s
Validation / validate-genesis (push) Successful in 30s
Validation / validate-terraform (push) Failing after 30s
Validation / validate-kubernetes (push) Failing after 13s
Validation / validate-smart-contracts (push) Failing after 11s
Validation / validate-security (push) Failing after 1m24s
Validation / validate-documentation (push) Failing after 20s
Verify Deployment / Verify Deployment (push) Failing after 1m7s

Align interoffice HO allocations to 2100→2410 with branch 1410→2100 two-leg entries, registry v1.2.1, explicit same-GL rejection in validators, doc matrices, and validation tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 10:11:44 -07:00
parent 9b3059beeb
commit 886a373356
9 changed files with 228 additions and 45 deletions

View File

@@ -0,0 +1,28 @@
{
"description": "HOSPITALLERS Office 24 — $1B M1 opening (two-leg). Branch leg posted live in Fineract; HO leg per Phase C.",
"source": "config/offices/office-24-opening-journal.v1.json",
"currencyCode": "USD",
"officeId": 24,
"entries": [
{
"memo": "T-H24-HO",
"officeId": 1,
"debitGlCode": "2100",
"creditGlCode": "2410",
"amount": 1000000000,
"narrative": "HOSPITALLERS-24 opening HO leg",
"ipsasRef": "IPSAS 28",
"moneyLayer": "M1"
},
{
"memo": "T-H24-BR",
"officeId": 24,
"debitGlCode": "1410",
"creditGlCode": "2100",
"amount": 1000000000,
"narrative": "HOSPITALLERS-24 opening branch leg (live post)",
"ipsasRef": "IPSAS 28",
"moneyLayer": "M1"
}
]
}

View File

@@ -0,0 +1,27 @@
{
"description": "Phase C interoffice two-leg pattern (canonical). HO: 2100→2410. Branch: 1410→2100. Mirrors live HOSPITALLERS-24 $1B opening.",
"source": "config/omnl-journal-matrix.json",
"currencyCode": "USD",
"entries": [
{
"memo": "T-002A-HO",
"officeId": 1,
"debitGlCode": "2100",
"creditGlCode": "2410",
"amount": 0,
"narrative": "Phase C HO leg template — Dr M1 circulating / Cr due to branch",
"ipsasRef": "IPSAS 28",
"moneyLayer": "M1"
},
{
"memo": "T-002A-BR",
"officeId": 2,
"debitGlCode": "1410",
"creditGlCode": "2100",
"amount": 0,
"narrative": "Phase C branch leg template — Dr due from HO / Cr M1 circulating",
"ipsasRef": "IPSAS 28",
"moneyLayer": "M1"
}
]
}

View File

@@ -11,7 +11,9 @@ Endpoints are served under **`/api/v1`** when the token-aggregation service is r
| File | Purpose |
|------|---------|
| [`config/omnl-ipsas-gl-registry.json`](../../config/omnl-ipsas-gl-registry.json) | Canonical GL codes (1000, 1050, 2000, 2100, 3000), IPSAS references, allowed pairs, monetary-layer hints |
| [`config/omnl-journal-matrix.json`](../../config/omnl-journal-matrix.json) | T-001…T-008 journal lines |
| [`config/omnl-journal-matrix.json`](../../config/omnl-journal-matrix.json) | IPSAS double-entry matrix (Phase C interoffice, M0M4, Office 24 opening) |
| [`docs/04-configuration/mifos-omnl-central-bank/omnl-journal-matrix-phase-c-interoffice.json`](../../docs/04-configuration/mifos-omnl-central-bank/omnl-journal-matrix-phase-c-interoffice.json) | Phase C HO/branch template |
| [`docs/04-configuration/mifos-omnl-central-bank/omnl-journal-matrix-hospitallers24-opening-1b.json`](../../docs/04-configuration/mifos-omnl-central-bank/omnl-journal-matrix-hospitallers24-opening-1b.json) | HOSPITALLERS-24 $1B opening two-leg reference |
Override paths with `OMNL_IPSAS_GL_REGISTRY` and `OMNL_JOURNAL_MATRIX_PATH` if needed.
@@ -64,4 +66,25 @@ Content-Type: application/json
{"pairs":[{"debitGlCode":"1050","creditGlCode":"2000"}]}
```
Expect `ipsasCompliantPair: true` when the pair is allowed in the registry or matrix.
Expect `ipsasCompliantPair: true` when the pair is allowed in the registry or matrix. Same-GL pairs (e.g. `2000/2000`) return `doubleEntryValid: false`, `rejectReason: "same_gl_account"`.
### Post-deploy validation (token-aggregation default port 3000)
```bash
# FAIL — same GL (invalid double entry)
curl -s "http://127.0.0.1:3000/api/v1/omnl/ipsas/validate-pair?debitGlCode=2000&creditGlCode=2000"
# PASS — Office 24 branch leg (live $1B pattern)
curl -s "http://127.0.0.1:3000/api/v1/omnl/ipsas/validate-pair?debitGlCode=1410&creditGlCode=2100"
# PASS — Phase C HO interoffice leg
curl -s "http://127.0.0.1:3000/api/v1/omnl/ipsas/validate-pair?debitGlCode=2100&creditGlCode=2410"
# PASS — M2→M3 token load
curl -s "http://127.0.0.1:3000/api/v1/omnl/ipsas/validate-pair?debitGlCode=2200&creditGlCode=2300"
# Reconcile anchor changes when registry/matrix updates
curl -s "http://127.0.0.1:3000/api/v1/omnl/reconcile-anchor"
```
**Phase C rule:** HO allocation uses **`2100 → 2410`** (not `2000 → 2410`). Branch leg **`1410 → 2100`**. GL `2100` is branch spendable M1 (matches Office 24 settlement profile `glM1`).