{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/events/dispatch-delivery-requested.schema.json",
  "title": "OMS dispatch delivery requested event",
  "type": "object",
  "additionalProperties": false,
  "required": ["dispatch_id", "dispatch_version", "worker_record_id", "ticket_id", "attempt", "lease_token", "requested_at"],
  "properties": {
    "dispatch_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "dispatch_version": { "const": 1 },
    "worker_record_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "ticket_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "attempt": { "type": "integer", "minimum": 1 },
    "lease_token": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "requested_at": { "type": "string", "minLength": 20, "maxLength": 24 }
  }
}
