Overview
This PR completes Epic 16 (Ironquery Analyst Pack Exports) PDF extension: a binary application/pdf streaming path alongside the existing CSV export, with BigInt ALE baselines and kWh-only physical units.
Core Implementations
app/api/internal/ironquery/export/route.ts: Handlesformat=pdf(query or POST body); streams PDF withcontent-disposition: attachment.app/utils/ironquery/pdfReportEncoder.ts: jsPDF + autotable layout;tenantUtilityLocationcontext; ALE cents as.toString()+ accounting USD display.scripts/vercel-integration-suite.mjs:npm run test:vercel-integration(tsc) and:live(cron smoke + CSV/PDF probes).
Verification & Testing Matrix
- TypeScript:
npx tsc --noEmit— pass - ESLint:
npx eslint .— 0 errors - Live preview (
feat/ironquery-pdf-exports): your provisioned workspace URL- Cron smoke: 21/21 (
freezeGateGreen=true) - Ironquery CSV probe: 200
text/csv - Ironquery PDF probe: 200
application/pdf(%PDF-1.3)
- Cron smoke: 21/21 (
GRC invariants
- ALE baselines: Medshield
1110000000n, Vaultbank590000000n, Gridcore470000000ncents - Physical unit gate:
kWhonly (non-kWh rejected) - Tenant isolation:
x-tenant-id+ Bearer cron auth viainternalTokenGatedApiPath()
Test plan
-
npm run test:vercel-integration -
STAGING_SMOKE_BASE_URL=<preview> npm run test:vercel-integration:live - Merge to
mainand production deploy