{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "eventType": {
      "type": "string"
    },
    "payloadVersion": {
      "type": "string"
    },
    "correlationId": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "statusCode": {
      "type": "number"
    },
    "case": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "number": {
          "type": "string",
          "description": "claim number, max size = 50"
        },
        "externalClaimId" : {
          "type": "string"
        },
        "token": {
          "type": "string",
          "description": "unique identifier for a claim, format - c.20ea9579-6ae7-4022-a6e6-334c90390051"
        },
        "caseType": {
          "type": "string",
          "description": "will always be contentClaim for this event"
        },
        "sourceSystem": {
          "type": "string"
        }
      }
    },
    "success": {
      "type": "boolean"
    },
    "errorDescription": {
      "type": [
        "string",
        "null"
      ]
    },
    "payload": {
      "type": "object",
      "properties": {
        "evaluationResult": {
          "type": "string",
          "enum": [
            "Approve",
            "Reject",
            "ManualEvaluation"
          ]
        },
        "newAssigneeType": {
          "type": "string"
        },
        "newAssigneeId": {
          "type": "string"
        },
        "isSelectedForTraining": {
          "type": "boolean"
        },
        "triggeredRules": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "publicMessage": {
                "type": "string"
              },
              "messageFormat": {
                "enum": [
                  "string",
                  "json"
                ]
              },
              "messageType": {
                "enum": [
                  "string",
                  "array"
                ]
              },
              "internalMessage": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "publicMessage",
              "internalMessage"
            ]
          }
        }
      },
      "required": [
        "evaluationResult",
        "newAssigneeType",
        "newAssigneeId",
        "isSelectedForTraining",
        "triggeredRules"
      ]
    }
  },
  "required": [
    "eventType", "timestamp", "case"
  ]
}