Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.30
    Preparing search index...

    Single source of truth for the canonical schema of every CSV file consumed by a Riksdagsmonitor dashboard.

    Each entry maps an absolute /cia-data/... path to:

    • requiredColumns: column names that MUST appear in the header row. Dashboard code is allowed to read ONLY these columns; any legacy fallback column read is a contract violation.
    • dashboard: human-readable dashboard slug the CSV belongs to (used for grouping in test output).
    • minRows: minimum number of data rows expected (defaults to 1).

    This contract is enforced from three sides:

    1. Build-time vitest contract test (tests/cia-csv-contracts.test.ts) walks the real cia-data/ tree and asserts every contract.
    2. Runtime validator (src/browser/cia/csv-validator.ts) checks fetched rows against this registry and throws a clear, visible Error so missing columns surface as an error banner instead of a silently-empty chart.
    3. Cypress contract spec (cypress/e2e/dashboards-per-chart/csv-contracts.cy.js) re-runs the same assertions against the served preview / production site, guarding the deploy pipeline.

    RULE: No legacy column fallbacks. If a CSV producer changes its schema, update this file (and the dashboard code that reads it) in the same commit. Do NOT add column_a ?? column_b fallbacks in dashboard rendering code.

    interface CsvContract {
    ย ย ย ย path: string;
    ย ย ย ย dashboard: string;
    ย ย ย ย requiredColumns: readonly string[];
    ย ย ย ย minRows?: number;
    }
    Index
    path: string
    dashboard: string
    requiredColumns: readonly string[]
    minRows?: number