{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.prisme-donnees.fr/depenses-publiques/schemas/relectures.schema.json",
  "title": "Journal de relecture : qui a relu quoi, quand, avec quels intérêts déclarés",
  "type": "object",
  "required": [
    "relecteurs",
    "relectures"
  ],
  "additionalProperties": false,
  "properties": {
    "relecteurs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "nom",
          "role",
          "declaration_interets"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]*$"
          },
          "nom": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "type": "string",
            "enum": [
              "scientifique",
              "neutralite",
              "verification",
              "contradictoire"
            ]
          },
          "affiliation": {
            "type": "string"
          },
          "declaration_interets": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "relectures": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "relecteur",
          "objet",
          "date",
          "conclusion"
        ],
        "additionalProperties": false,
        "properties": {
          "relecteur": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]*$"
          },
          "objet": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
          },
          "conclusion": {
            "type": "string",
            "minLength": 1
          },
          "suites": {
            "type": "string"
          }
        }
      }
    }
  }
}
