{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/runtime-persistence-event.schema.json",
  "title": "Wever Labs Runtime Persistence Event",
  "type": "object",
  "required": [
    "event_id",
    "event_type",
    "record_id",
    "record_type",
    "created_at"
  ],
  "properties": {
    "event_id": {
      "type": "string"
    },
    "event_type": {
      "type": "string",
      "enum": [
        "record_created",
        "record_updated",
        "state_advanced",
        "receipt_issued",
        "callback_queued",
        "callback_delivered",
        "callback_failed",
        "attestation_issued",
        "exception_opened",
        "replay_ready",
        "recovery_closed"
      ]
    },
    "record_id": {
      "type": "string"
    },
    "record_type": {
      "type": "string"
    },
    "task_token": {
      "type": "string"
    },
    "previous_state": {
      "type": "string"
    },
    "next_state": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "payload": {
      "type": "object"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}
