{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sportops.it/formato/schema/legami_familiari.schema.json",
  "title": "Legami familiari",
  "description": "Chi è genitore o tutore di chi.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "genitore_id": {
        "type": [
          "integer",
          "null"
        ],
        "description": "→ famiglie.id"
      },
      "atleta_id": {
        "type": [
          "integer",
          "null"
        ],
        "description": "→ atleti.id"
      },
      "relazione": {
        "type": [
          "string",
          "null"
        ],
        "description": "PADRE, MADRE, TUTORE, NONNO, NONNA, ZIO, ZIA, ALTRO.",
        "enum": [
          "PADRE",
          "MADRE",
          "TUTORE",
          "NONNO",
          "NONNA",
          "ZIO",
          "ZIA",
          "ALTRO",
          null
        ]
      },
      "contatto_principale": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "È il contatto principale."
      },
      "puo_ritirare": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "Può ritirare l'atleta."
      },
      "contatto_emergenza": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "Contatto per le emergenze."
      },
      "attivo": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "Legame in essere."
      }
    },
    "required": [
      "genitore_id",
      "atleta_id",
      "relazione",
      "contatto_principale",
      "puo_ritirare",
      "contatto_emergenza",
      "attivo"
    ],
    "additionalProperties": false
  }
}