fix: clarify IMF real GDP local-currency units#4072
Conversation
|
@patrykcodex-del is attempting to deploy a commit to the World Monitor Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR renames the
Confidence Score: 3/5Safe to merge with one follow-up: the schema version should be bumped before any code that reads The rename is consistent across the seeder, the TypeScript interface, and all test fixtures, and no production code currently reads the renamed field so there is no immediate regression. However, the codebase convention requires the scripts/seed-imf-growth.mjs — the Important Files Changed
Sequence DiagramsequenceDiagram
participant Railway as Railway Cron
participant Seeder as seed-imf-growth.mjs
participant IMF as IMF SDMX API
participant Redis as Redis Cache
participant Bootstrap as /api/bootstrap
participant Client as SPA Client
Railway->>Seeder: trigger (every ~35 days)
Seeder->>IMF: fetch NGDP_R (+ 6 other indicators)
IMF-->>Seeder: per-country series
Seeder->>Seeder: buildGrowthCountries() maps ISO3→ISO2, writes realGdpLcuB
Seeder->>Redis: "SET economic:imf:growth:v1 { countries: { US: { realGdpLcuB } } }"
Client->>Bootstrap: "GET /api/bootstrap?keys=imfGrowth"
Bootstrap->>Redis: GET economic:imf:growth:v1
Redis-->>Bootstrap: cached payload
Bootstrap-->>Client: ImfGrowthEntry[] with realGdpLcuB field
|
Summary
NGDP_Rfield for real GDP in local currency units instead of the ambiguousRGDPalias.economic:imf:growth:v1cache key and WEO aggregate filtering / ISO3→ISO2 behavior.Test plan
npm run test:data -- tests/seed-imf-extended.test.mjs tests/imf-country-data.test.mts✅ (10,483 passed / 0 failed / 6 skipped; fulltest:datasuite runs due package script glob)npm run typecheck✅npx biome lint scripts/seed-imf-growth.mjs src/services/imf-country-data.ts tests/imf-country-data.test.mts tests/seed-imf-extended.test.mjs✅npm run lint:safe-html✅git diff --check origin/main...HEAD✅Closes #3837