feat(economic): add FAO Food Price Index panel (#2682)

* feat(economic): add FAO Food Price Index panel

Adds a new panel tracking the FAO Global Food Price Index (FFPI) for the
past 12 months, complementing existing consumer prices, fuel prices, and
Big Mac Index trackers.

- proto: GetFaoFoodPriceIndex RPC with 6-series response (Food, Cereals,
  Meat, Dairy, Oils, Sugar + MoM/YoY pct)
- seeder: seed-fao-food-price-index.mjs with 90-day TTL (3× monthly),
  isMain guard, parseVal NaN safety, correct 13-point slice
- handler/gateway: static tier RPC wired into economicHandler
- bootstrap/health: bootstrapped as SLOW_KEY; maxStaleMin=86400 (60 days)
- panel: SVG multi-line chart with 6 series, auto-scaled Y axis, headline
  with MoM/YoY indicators, info tooltip, bootstrap hydration
- CMD+K: panel:fao-food-price-index with fao/ffpi/food keywords
- Railway: fao-ffpi cron seeder service (0.5 vCPU, 0.5 GB, daily 08:45)
- locales: full en.json keys for panel UI strings
- ais-relay: faoFoodPriceIndex added to economic bootstrap context

* fix(economic): add faoFoodPriceIndex to cache-keys.ts BOOTSTRAP_CACHE_KEYS and BOOTSTRAP_TIERS

* fix(economic): correct cron comment in fao seeder to reflect daily schedule
This commit is contained in:
Elie Habib
2026-04-04 17:33:54 +04:00
committed by GitHub
parent 9de81ecb2c
commit 4e9f25631c
23 changed files with 560 additions and 3 deletions

View File

@@ -702,6 +702,32 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/economic/v1/get-fao-food-price-index:
get:
tags:
- EconomicService
summary: GetFaoFoodPriceIndex
description: GetFaoFoodPriceIndex retrieves the FAO Food Price Index for the past 12 months.
operationId: GetFaoFoodPriceIndex
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetFaoFoodPriceIndexResponse'
"400":
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Error:
@@ -1919,3 +1945,46 @@ components:
format: double
missing:
type: boolean
GetFaoFoodPriceIndexRequest:
type: object
GetFaoFoodPriceIndexResponse:
type: object
properties:
points:
type: array
items:
$ref: '#/components/schemas/FaoFoodPricePoint'
fetchedAt:
type: string
currentFfpi:
type: number
format: double
momPct:
type: number
format: double
yoyPct:
type: number
format: double
FaoFoodPricePoint:
type: object
properties:
date:
type: string
ffpi:
type: number
format: double
meat:
type: number
format: double
dairy:
type: number
format: double
cereals:
type: number
format: double
oils:
type: number
format: double
sugar:
type: number
format: double