{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://modele-donnees-filiere-enquete.insee.fr/specs/2.3.0/ProcessedResponse.json",
  "type": "object",
  "description": "Represents processed response for external system associated with a questionnaire",
  "properties": {
    "interrogationId": {
      "description": "Unique identifier for the interrogation",
      "type": "string"
    },
    "technicalSurveyUnitId": {
      "description": "Unique technical id for the survey unit",
      "type": "string",
      "nullable": true
    },
    "usualSurveyUnitId": {
      "description": "Usual survey unit id used by external system (business identifier)",
      "type": "string"
    },
    "partitionId": {
      "description": "Unique identifier for the partition",
      "type": "string",
      "nullable": true
    },
    "partitionShortLabel": {
      "description": "Short label for the partition",
      "type": "string",
      "nullable": true
    },
    "collectionInstrumentId": {
      "description": "Unique id for the questionnaire model instrument",
      "type": "string"
    },
    "mode": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "title": "Mode",
      "description": "Collect modes",
      "type": "string",
      "enum": [
        "CATI",
        "CAPI",
        "CAWI",
        "PAPI"
      ]
    },
    "isCapturedIndirectly": {
      "description": "Indicates if questionnaire is captured indirectly",
      "type": "boolean"
    },
    "questionnaireState": {
      "description": "State information about the questionnaire ",
      "type": "string",
      "enum": [
        "STARTED",
        "FINISHED"
      ]
    },
    "validationDate": {
      "description": "Indicates the validation date of the questionnaire (null if partial)",
      "type": "string",
      "nullable": true,
      "format": "date-time",
      "x-field-extra-annotation": "@com.fasterxml.jackson.annotation.JsonFormat(shape = com.fasterxml.jackson.annotation.JsonFormat.Shape.STRING, timezone = \"UTC\")"
    },
    "data": {
      "description": "Data extracted via Kraftwerk",
      "type": "object",
      "properties": {
        "RACINE": {
          "description": "Data with the scope questionnaire",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ],
              "nullable": true
            }
          }
        }
      },
      "required": [
        "RACINE"
      ],
      "additionalProperties": {
        "description": "Data in loops/dynamic table",
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ],
            "nullable": true
          }
        }
      }
    }
  },
  "required": [
    "interrogationId",
    "collectionInstrumentId",
    "partitionId",
    "mode",
    "isCapturedIndirectly",
    "questionnaireState",
    "data"
  ]
}