{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "eventType": {
      "type": "string",
      "description": "for this type of event it is always - auto_settlement_failed"
    },
    "payloadVersion": {
      "type": "string",
      "description": "format - 1.0.0"
    },
    "correlationId": {
      "type": "string",
      "description": "id used to correlate behavior in backend system"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "format - yyyy-MM-dd'T'HH:mm:ss.SSSZ"
    },
    "case": {
      "$ref": "#/definitions/case"

    },
    "error": {
      "$ref": "#/definitions/error"
    }
  },
  "required": [
    "eventType",
    "payloadVersion",
    "timestamp",
    "case"
  ],
  "definitions": {
    "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}$"
    },
    "error": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "FRAUD_ALERT"
        },
        "message": {
          "type": "string",
          "description": "description of the error"
        }
      },
      "required": [
        "type"
      ]
    },
    "case": {
      "type": "object",
      "properties": {
        "uuid": {
          "$ref": "#/definitions/uuid",
          "description": "uniqie identifier for a claim, format - 20ea9579-6ae7-4022-a6e6-334c90390051"
        },
        "number": {
          "type": "string",
          "description": "claim number, max size = 50"
        },
        "token": {
          "type": "string",
          "description": "unique identifier for a claim, format - c.20ea9579-6ae7-4022-a6e6-334c90390051"
        },
        "caseType": {
          "type": "string",
          "description": "e.g.: privateMedicalInsuranceClaim, motorClaim, buildingClaim, buildingRiskAssessment, contentClaim, contentItemization"
        },
        "externalClaimId": {
          "type": "string",
          "description": "internal case number of the insurance company, max size = 50"
        },
        "company": {
          "type": "string",
          "description": "name of the insurance company, max size 256"
        }
      },
      "required": [
        "uuid",
        "token",
        "number"
      ]
    }
  }
}
