Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
1.8 KiB
Bash
Executable File
59 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Validate OMNL Central Bank configuration: currencies, CoA structure, key accounts.
|
|
# GET-based checks only. Run from project root. Exit 0 if all checks pass.
|
|
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=lib.sh
|
|
source "${SCRIPT_DIR}/lib.sh"
|
|
|
|
fail_if_no_credentials
|
|
|
|
errors=0
|
|
|
|
echo "=== OMNL Central Bank — Configuration validation ==="
|
|
echo "Base URL: $MIFOS_BASE_URL"
|
|
echo ""
|
|
|
|
# 1) Currencies
|
|
resp=$(api_get "currencies")
|
|
if [ "${MIFOS_HTTP_CODE:-0}" != "200" ]; then
|
|
echo "FAIL: GET /currencies returned HTTP ${MIFOS_HTTP_CODE:-0}" >&2
|
|
((errors++)) || true
|
|
else
|
|
echo "PASS: Currencies endpoint reachable"
|
|
# Optional: check for at least one currency in response
|
|
if echo "$resp" | grep -qE "USD|EUR|XAU|currencyOptions|selectedCurrencyOptions"; then
|
|
echo "PASS: Currency configuration present"
|
|
else
|
|
echo "WARN: Could not detect currency list; ensure base + selected currencies are configured in UI" >&2
|
|
fi
|
|
fi
|
|
|
|
# 2) GL accounts — required headers and M00/M0/M1
|
|
resp=$(api_get "glaccounts")
|
|
if [ "${MIFOS_HTTP_CODE:-0}" != "200" ]; then
|
|
echo "FAIL: GET /glaccounts returned HTTP ${MIFOS_HTTP_CODE:-0}" >&2
|
|
((errors++)) || true
|
|
else
|
|
echo "PASS: GL accounts endpoint reachable"
|
|
required_codes="10000 20000 21000 22000 23000 30000 40000 50000 42100 52100"
|
|
for code in $required_codes; do
|
|
if echo "$resp" | grep -q "\"glCode\":\"${code}\""; then
|
|
echo " [ok] $code"
|
|
else
|
|
echo " [missing] $code" >&2
|
|
((errors++)) || true
|
|
fi
|
|
done
|
|
fi
|
|
|
|
echo ""
|
|
if [ "$errors" -eq 0 ]; then
|
|
echo "Validation passed. See docs/04-configuration/mifos-omnl-central-bank/POST_DEPLOYMENT_VALIDATION_CHECKLIST.md"
|
|
exit 0
|
|
else
|
|
echo "Validation had $errors failure(s). Fix configuration and re-run." >&2
|
|
exit 1
|
|
fi
|