{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "event-intrusion",
  "$version": 1,
  "title": "CVEDIA-RT Intrusion Event Data v1",
  "description": "JSON schema for area intrusion event data exported by CVEDIA-RT",
  "type": "object",
  "properties": {
    "event_id": {
      "description": "Unique identifier for the event",
      "type": "string"
    },
    "area_id": {
      "description": "Unique identifier for the area",
      "type": "string"
    },
    "area_name": {
      "description": "Name of the area",
      "type": "string"
    },
    "system_timestamp": {
      "description": "System timestamp in milliseconds since epoch of the event",
      "type": "integer"
    },
    "system_datetime": {
      "description": "System datetime of the event (RFC3339)",
      "type": "string",
      "format": "date-time"
    },
    "instance_id": {
      "description": "ID of the camera that captured the event",
      "type": "string"
    },
    "event_timestamp_ms": {
      "description": "Event timestamp in milliseconds",
      "type": "integer"
    },
    "location": {
      "description": "Location bounding box. The bounding box is relative to the frame size (0,0) being the top-left corner and (1,1) being the bottom-right corner.",
      "type": "object",
      "properties": {
        "x": {
          "description": "Relative X-coordinate of the bounding box's top-left corner",
          "type": "number"
        },
        "y": {
          "description": "Relative Y-coordinate of the bounding box's top-left corner",
          "type": "number"
        },
        "width": {
          "description": "Relative Width of the bounding box",
          "type": "number"
        },
        "height": {
          "description": "Relative Height of the bounding box",
          "type": "number"
        },
        "guid": {
          "description": "[Deprecated since 2024.1.0] Unique ID of the bounding box (within one frame). Can be used to link to the crops exports.",
          "type": "string"
        }
      },
      "required": [
        "x",
        "y",
        "width",
        "height"
      ]
    },
    "ref_tracking_id": {
      "description": "ID of the reference track",
      "type": "string"
    },
    "object_class": {
      "description": "Class of the object",
      "type": "string"
    }
  },
  "required": [
    "event_id",
    "area_id",
    "area_name",
    "system_timestamp",
    "system_datetime",
    "instance_id",
    "event_timestamp_ms",
    "location",
    "object_class"
  ]
}