{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.prisme-donnees.fr/depenses-publiques/schemas/verifications.schema.json",
  "title": "Vérification humaine des valeurs d'un dispositif (décision D15)",
  "type": "object",
  "required": [
    "dispositif",
    "verifications"
  ],
  "additionalProperties": false,
  "properties": {
    "dispositif": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]*$"
    },
    "verifications": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "valeur",
          "empreinte",
          "resultat",
          "page_relue",
          "par",
          "date"
        ],
        "additionalProperties": false,
        "properties": {
          "valeur": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]*$"
          },
          "empreinte": {
            "type": "string",
            "pattern": "^[0-9a-f]{12}$"
          },
          "resultat": {
            "type": "string",
            "enum": [
              "conforme",
              "non_conforme"
            ]
          },
          "page_relue": {
            "type": "integer",
            "minimum": 1
          },
          "par": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
          },
          "note": {
            "type": "string"
          }
        }
      }
    }
  }
}
