{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://data.publicinformation.ie/schemas/staff-numbers.schema.json",
  "title": "Public Service Staff Numbers Record",
  "description": "Full-time-equivalent (FTE) staff numbers for one row of the Department of Public Expenditure's public service numbers file, for one quarter, linked to a public body where the row could be resolved to one",
  "type": "object",
  "properties": {
    "@id": {"type": "string", "format": "uri", "description": "Persistent URI for this staff-numbers record; embeds the period and a slug of the source key"},
    "@type": {"type": "string", "const": "sn:StaffNumbersRecord"},
    "@context": {"type": "object"},
    "public_body": {"type": ["string", "null"], "format": "uri", "description": "URI of the public body this row belongs to (the same @id published in the public-bodies dataset); null when match_status is unmatched"},
    "match_status": {"type": "string", "enum": ["exact", "rule", "override", "unmatched"], "description": "How the row was tied to a public body: exact = identical name after normalisation; rule = local authority label rewritten then matched exactly; override = a human-reviewed decision; unmatched = no single public body (aggregates, sub-units, or not yet reviewed)"},
    "year": {"type": "integer", "minimum": 2008, "description": "Calendar year of the reporting quarter"},
    "quarter": {"type": "integer", "minimum": 1, "maximum": 4, "description": "Calendar quarter (1-4)"},
    "source_name": {"type": "string", "minLength": 1, "description": "Body name as written in the source file (its Level_6, else Level_5)"},
    "source_department": {"type": "string", "description": "The source's department grouping (Level_2)"},
    "source_category": {"type": "string", "description": "The source's category (Level_4), e.g. Civil Service, Local Authorities, Non Commercial State Agencies"},
    "source_key": {"type": "string", "minLength": 1, "description": "Stable identity of the source row: its non-empty Level_4, Level_5 and Level_6 joined by ' | '"},
    "fte": {"type": ["number", "null"], "minimum": 0, "description": "Full-time-equivalent staff in the row, not headcount; null if the source cell was not a plain number"}
  },
  "required": ["@id", "@type", "public_body", "match_status", "year", "quarter", "source_name", "source_department", "source_category", "source_key", "fte"]
}
