{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sportops.it/formato/schema/prima_nota.schema.json",
  "title": "Prima nota",
  "description": "Tutti i movimenti di cassa registrati in tesoreria.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Identificativo."
      },
      "data": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "description": "Data del movimento."
      },
      "verso": {
        "type": [
          "string",
          "null"
        ],
        "description": "entrata o uscita."
      },
      "importo_cent": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Importo in centesimi."
      },
      "conto_codice": {
        "type": [
          "string",
          "null"
        ],
        "description": "→ conti.codice"
      },
      "conto_nome": {
        "type": [
          "string",
          "null"
        ],
        "description": "Nome del conto, per leggere senza incrociare."
      },
      "cassa": {
        "type": [
          "string",
          "null"
        ],
        "description": "Nome della cassa o del conto corrente."
      },
      "controparte": {
        "type": [
          "string",
          "null"
        ],
        "description": "Chi ha pagato o è stato pagato."
      },
      "descrizione": {
        "type": [
          "string",
          "null"
        ],
        "description": "Descrizione."
      },
      "doc_tipo": {
        "type": [
          "string",
          "null"
        ],
        "description": "Tipo di documento (ricevuta, fattura…)."
      },
      "doc_numero": {
        "type": [
          "string",
          "null"
        ],
        "description": "Numero del documento."
      },
      "doc_data": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "description": "Data del documento."
      },
      "stagione": {
        "type": [
          "string",
          "null"
        ],
        "description": "→ stagioni.nome"
      },
      "natura": {
        "type": [
          "string",
          "null"
        ],
        "description": "Natura (istituzionale, commerciale…)."
      },
      "iva_percent": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Aliquota IVA, se c'è."
      },
      "iva_cent": {
        "type": [
          "integer",
          "null"
        ],
        "description": "IVA in centesimi."
      },
      "allegato": {
        "type": [
          "string",
          "null"
        ],
        "description": "Nome del file allegato in storage/accounting/, se c'è."
      }
    },
    "required": [
      "id",
      "data",
      "verso",
      "importo_cent",
      "conto_codice",
      "conto_nome",
      "cassa",
      "controparte",
      "descrizione",
      "doc_tipo",
      "doc_numero",
      "doc_data",
      "stagione",
      "natura",
      "iva_percent",
      "iva_cent",
      "allegato"
    ],
    "additionalProperties": false
  }
}