{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://department-for-transport-streetmanager.github.io/street-manager-docs/api-documentation/json/event-notifier-message.json",
  "title": "Event Notifier Message",
  "description": "A notification message a subscriber will receive when subscribed to a topic",
  "type": "object",
  "properties": {
    "event_reference": {
      "description": "The unique reference for this event",
      "type": "integer"
    },
    "event_type": {
      "description": "EVENT",
      "type": "string"
    },
    "object_type": {
      "description": "The type of object",
      "type": "string",
      "enum": [
        "PERMIT",
        "REINSTATEMENT",
        "INSPECTION",
        "FPN",
        "PAA",
        "WORK",
        "FORWARD_PLAN",
        "COMMENT",
        "SCHEDULED_INSPECTION",
        "SECTION_81",
        "CHANGE_REQUEST",
        "APPLICATION",
        "SAMPLE_INSPECTION",
        "SECTION_74",
        "SITE",
        "SAMPLE_INSPECTION_TARGET",
        "NON_COMPLIANCE",
        "PRIVATE_STREET"
      ]
    },
    "event_details":{
      "description": "The event which ocurred in Street Manager",
      "type": "string"
    },
    "event_time": {
      "description": "The time the event occurred and was submitted in Street Manager",
      "type": "string",
      "format": "date-time"
    },
    "workstream_prefix": {
      "description": "The workstream associated with the work",
      "type": "string"
    },
    "work_reference_number": {
      "description": "Reference number unique to a Work",
      "type": "string"
    },
    "object_reference": {
      "description": "The reference number of the object",
      "type": "string"
    },
    "user_name": {
      "description": "The logged in user who performed the action which triggered the event",
      "type": "string"
    },
    "version": {
      "description": "The JSON schema version",
      "type": "integer"
    }
  },
  "required": [
    "event_reference",
    "event_type",
    "object_type",
    "event_details",
    "event_time",
    "workstream_prefix",
    "work_reference_number",
    "object_reference",
    "user_name",
    "version"
  ]
}
