{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sportops.it/formato/schema/staff_squadre.schema.json",
  "title": "Staff delle squadre",
  "description": "Chi segue quale squadra.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "squadra_id": {
        "type": [
          "integer",
          "null"
        ],
        "description": "→ squadre.id"
      },
      "persona_id": {
        "type": [
          "integer",
          "null"
        ],
        "description": "→ allenatori.id oppure dirigenti.id, secondo «tipo»."
      },
      "tipo": {
        "type": [
          "string",
          "null"
        ],
        "description": "COACH = allenatore, DIRECTOR = dirigente.",
        "enum": [
          "COACH",
          "DIRECTOR",
          null
        ]
      },
      "ruolo": {
        "type": [
          "string",
          "null"
        ],
        "description": "Ruolo nello staff (primo allenatore, preparatore…)."
      },
      "attivo": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "In carica."
      }
    },
    "required": [
      "squadra_id",
      "persona_id",
      "tipo",
      "ruolo",
      "attivo"
    ],
    "additionalProperties": false
  }
}