{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ectropy.ai/flow/intake/inspection-intake.schema.json",
  "title": "Inspection Intake (ISx)",
  "version": "0.2.0",
  "description": "An inspection result as an inspector, testing lab or authority reports it, on the ISx inspection-status vocabulary. Every instance must also validate against GS1's EPCIS 2.0.1 JSON Schema; this profile only narrows it.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://schemas.ectropy.ai/flow/flow-common.schema.json#/definitions/epcisEventCore"
    },
    {
      "properties": {
        "type": {
          "enum": [
            "ObjectEvent"
          ]
        },
        "bizStep": {
          "enum": [
            "inspecting"
          ]
        },
        "ectropy:inspection": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "inspectionRef",
            "result"
          ],
          "properties": {
            "inspectionRef": {
              "$ref": "https://schemas.ectropy.ai/flow/flow-common.schema.json#/definitions/partyUri"
            },
            "result": {
              "enum": [
                "pass",
                "fail",
                "conditional"
              ]
            },
            "isxStatus": {
              "type": "string",
              "description": "Value from the ISx inspection-status vocabulary."
            }
          }
        }
      },
      "required": [
        "ectropy:inspection"
      ]
    }
  ]
}
