fix: Fineract GL balances via journal fallback when report missing
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m15s
CI/CD Pipeline / Security Scanning (push) Successful in 2m16s
CI/CD Pipeline / Lint and Format (push) Failing after 48s
CI/CD Pipeline / Terraform Validation (push) Failing after 28s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 29s
Validation / validate-genesis (push) Successful in 32s
Validation / validate-terraform (push) Failing after 31s
Validation / validate-kubernetes (push) Failing after 13s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m20s
Validation / validate-documentation (push) Failing after 21s
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m15s
CI/CD Pipeline / Security Scanning (push) Successful in 2m16s
CI/CD Pipeline / Lint and Format (push) Failing after 48s
CI/CD Pipeline / Terraform Validation (push) Failing after 28s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 29s
Validation / validate-genesis (push) Successful in 32s
Validation / validate-terraform (push) Failing after 31s
Validation / validate-kubernetes (push) Failing after 13s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m20s
Validation / validate-documentation (push) Failing after 21s
Use journalentry replay when General Ledger Report is unavailable, and expose fineractConnected on the public money-supply endpoint. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import { processTransfer } from '../../workflows/transfer';
|
||||
import { bindOffice24 } from '../../workflows/office-scope';
|
||||
import { settlementStore } from '../../store/settlement-store';
|
||||
import { processSwiftInbound } from '../../workflows/swift-inbound';
|
||||
import { fetchGlBalances } from '../../adapters/fineract';
|
||||
import { fetchGlBalances, fineractOfficeReachable } from '../../adapters/fineract';
|
||||
|
||||
function requireApiKey(req: Request, res: Response): boolean {
|
||||
const cfg = loadConfig();
|
||||
@@ -68,11 +68,16 @@ export function createSettlementRouter(): Router {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const balances = await fetchGlBalances(officeId);
|
||||
const [balances, fineractConnected] = await Promise.all([
|
||||
fetchGlBalances(officeId),
|
||||
fineractOfficeReachable(officeId),
|
||||
]);
|
||||
const snapshot = buildMoneySupplySnapshot(officeId, balances);
|
||||
const hasActivity = Object.values(balances).some((v) => Math.abs(parseFloat(v) || 0) > 0);
|
||||
res.json({
|
||||
...snapshot,
|
||||
fineractLive: Object.keys(balances).length > 0,
|
||||
fineractConnected,
|
||||
fineractLive: fineractConnected && hasActivity,
|
||||
interoffice: {
|
||||
dueFromHeadOffice: balances['1410'] ?? '0',
|
||||
gl1410: balances['1410'] ?? '0',
|
||||
|
||||
Reference in New Issue
Block a user