{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://modele-donnees-filiere-enquete.insee.fr/specs/2.3.0/CommandRequest.json",
  "title": "CommandRequest",
  "description": "The command sent by Protools to the command store",
  "type": "object",
  "properties": {
    "correlationId": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the CommandRequest, to be created by the commandEngine"
    },
    "processInstanceId": {
      "type": "string",
      "description": "BPMN process identifier",
      "format": "uuid"
    },
    "target": {
      "type": "string",
      "description": "Target system of the command",
      "enum": [
        "QUESTIONNAIRE-API-WEB",
        "PILOTAGE-API-WEB"
      ]
    },
    "operation": {
      "type": "string",
      "description": "Operation to perform on the aggregate",
      "enum": [
        "CREATE"
      ]
    },
    "payload": {
      "type": "object",
      "description": "Payload of type aggregateType",
      "additionalProperties": true
    },
    "aggregateType": {
      "type": "string",
      "enum": [
        "INTERROGATION"
      ]
    }
  },
  "required": [
    "processInstanceId",
    "target",
    "operation",
    "payload",
    "aggregateType"
  ]
}