Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- Add OMNL/CBK Indonesia submission and audit binder docs, manifests, attestations - Add scripts/omnl transaction-package pipeline, LEI/PvP helpers, jq/lib fixtures - Update entity master data, MASTER_INDEX, TODOS, dbis-rail docs and rulebook - Add proof_package/regulatory skeleton and transaction package zip + snapshot JSON - validate-omnl-rail workflow, forge-verification-proxy tweak, .gitignore hygiene - Bump smom-dbis-138 (cronos verify docs/scripts) and explorer-monorepo (SPA + env report) Made-with: Cursor
51 lines
1.9 KiB
Plaintext
51 lines
1.9 KiB
Plaintext
# Enrich omnl_transaction_package_snapshot.json with OMNL_ENTITY_MASTER_DATA.json.
|
|
# Usage: jq --argjson master "$(jq -c . OMNL_ENTITY_MASTER_DATA.json)" -f enrich-snapshot-entity-master.jq snapshot.json
|
|
# Joins registry LEI / entity names to each Fineract office (id 1, HO-OMNL, OMNL-N, or externalId == accountNo).
|
|
|
|
($master.entities) as $ents
|
|
| . as $root
|
|
| $root.snapshotMeta as $sm
|
|
| ($ents | map(select(.clientNumber == 1)) | .[0] // null) as $ho
|
|
| $root
|
|
| .offices |= map(
|
|
. as $o
|
|
| [
|
|
$ents[]
|
|
| select(
|
|
($o.id == 1 and .clientNumber == 1)
|
|
or (($o.externalId // "" | tostring) == "HO-OMNL" and .clientNumber == 1)
|
|
or (
|
|
($o.externalId // "" | tostring | test("^OMNL-[0-9]+$"))
|
|
and .clientNumber == ($o.externalId | ltrimstr("OMNL-") | tonumber)
|
|
)
|
|
or (
|
|
(($o.externalId // "") | tostring | length) > 0
|
|
and ((.accountNo // "") | tostring) == (($o.externalId // "") | tostring)
|
|
)
|
|
)
|
|
]
|
|
| .[0]
|
|
| . as $e
|
|
| $o
|
|
| . + {
|
|
registryClientNumber: (if $e == null then null else $e.clientNumber end),
|
|
registryEntityName: (if $e == null then null else $e.entityName end),
|
|
registryLei: (if $e == null then "" else ($e.lei // "") end)
|
|
}
|
|
)
|
|
| .snapshotMeta = (
|
|
$sm
|
|
+ {
|
|
omnlLei: (if (($ho.lei // "") | length) > 0 then $ho.lei else $sm.omnlLei end),
|
|
omnlLeiReferenceUrl: (
|
|
if (($ho.lei // "") | length) > 0
|
|
then ("https://lei.info/" + $ho.lei)
|
|
else $sm.omnlLeiReferenceUrl
|
|
end
|
|
),
|
|
registryHeadOfficeEntityName: ($ho.entityName // null),
|
|
entityMasterDataSource: "OMNL_ENTITY_MASTER_DATA.json",
|
|
officeRegistryModel: "Fineract offices + LEI/entity overlay from OMNL_ENTITY_MASTER_DATA.json (LEI is not stored as a Fineract office column)."
|
|
}
|
|
)
|