{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "analysis-v1.json",
  "title": "Displacement Analysis results table, version 1",
  "description": "One CSV row per geography, year, direction and group. The Analysis team delivers aggregated, de-identified counts; no row describes an individual household. Agreed with the Analysis team in the first month of the dashboard contract; columns may be added, never renamed.",
  "type": "object",
  "required": ["geography_type", "geography_id", "year", "direction", "households"],
  "properties": {
    "geography_type": {"enum": ["station_area", "corridor", "region", "control_corridor"]},
    "geography_id": {"type": "string", "description": "For station_area: <line id>/<station id> as in data/dashboard.json (for example green-line/snelling). For corridor: the line id. For region: metro. For control_corridor: the Analysis team's id."},
    "year": {"type": "integer", "minimum": 2006, "maximum": 2025},
    "direction": {"enum": ["in", "out", "stayed"]},
    "income_band": {"enum": ["under_30_ami", "30_50_ami", "50_80_ami", "over_80_ami", "unknown", ""]},
    "race_ethnicity": {"type": "string", "description": "The Analysis team's categories, spelled the same in every row."},
    "households": {"type": ["integer", "null"], "minimum": 0, "description": "Null when the cell is suppressed below the minimum count the Analysis team sets."},
    "project_phase": {"enum": ["pre-development", "planning", "construction", "operation", ""]},
    "note": {"type": "string"}
  },
  "additionalProperties": true
}
