{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://m365tracker.cloudidentity.se/api/v1/schema/event.schema.json",
  "title": "M365 Change Tracker event",
  "type": "object",
  "description": "an item snapshot plus the change detected this run",
  "required": [
    "eventId",
    "id",
    "type",
    "detectedAt"
  ],
  "properties": {
    "eventId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "type": {
      "enum": [
        "new",
        "updated",
        "status-changed",
        "removed"
      ]
    },
    "detectedAt": {
      "type": "string",
      "format": "date-time"
    },
    "fromStatus": {
      "type": "string"
    },
    "toStatus": {
      "type": "string"
    },
    "transitions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      }
    },
    "diff": {
      "type": "object",
      "description": "{title?,description?} as [{t:eq|del|add,v}] sentence segments"
    },
    "diffSummary": {
      "type": "string"
    },
    "cosmetic": {
      "type": "boolean"
    },
    "editIntent": {
      "type": "string",
      "description": "derived: Target date changed / Licensing changed / Scope narrowed / …"
    }
  }
}