Fix macro indicators: add working retail sales and employment FRED series

Retail Sales: switch all currencies to *SLRTTO01GPSAM format (OECD monthly,
already in MoM%) — covers USD, EUR(DEU proxy), GBP, JPY, CHF, CAD.
Remove retailSales from PCT_FIELDS since values are already percentages.

Employment: add LFEMTTTT*647S series (monthly levels → MoM%) for JPY, CAD,
AUD and quarterly for NZD. These replace null/non-existent FRED series.

PMI stays ⚠ — no free real-time source found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Capucine Gest
2026-05-28 21:55:51 +02:00
co-authored by Claude Sonnet 4.6
parent abf04aabbd
commit 3fcb72a25e
2 changed files with 45 additions and 39 deletions
+4 -3
View File
@@ -127,9 +127,10 @@ export async function GET(req: NextRequest) {
if (!key) return NextResponse.json({ error: "FRED_API_KEY missing" }, { status: 500 });
// Fields and which need period-over-period % conversion
// policyRate / unemployment → already in % → toIndicator
// cpiCore / gdp / retailSales / employment → index/level → toIndicatorPct (MoM% or QoQ%)
const PCT_FIELDS = new Set(["cpiCore", "gdp", "retailSales", "employment"]);
// policyRate / unemployment / retailSales → already in % → toIndicator
// (retailSales uses *SLRTTO01GPSAM series which report MoM% directly)
// cpiCore / gdp / employment → index/level → toIndicatorPct (MoM% or QoQ%)
const PCT_FIELDS = new Set(["cpiCore", "gdp", "employment"]);
const fieldMap: Record<string, string | null> = {
policyRate: series.policyRate,