{
  "$id": "https://capitalguard.io/gateway/v0.1.0/gateway-event.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "claimBoundary": {
      "const": "CapitalGuard enforces only operations submitted through this gateway. It cannot monitor or control operations that bypass the gateway."
    },
    "decision": {
      "type": "object"
    },
    "enforcement": {
      "type": "object"
    },
    "eventHashSha256": {
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    },
    "eventId": {
      "pattern": "^CGG-[A-Z0-9][A-Z0-9-]{15,91}$",
      "type": "string"
    },
    "eventType": {
      "const": "gateway.operation_evaluated"
    },
    "occurredAt": {
      "format": "date-time",
      "type": "string"
    },
    "policy": {
      "type": "object"
    },
    "previousEventHashSha256": {
      "type": [
        "string",
        "null"
      ]
    },
    "privacy": {
      "type": "object"
    },
    "request": {
      "type": "object"
    },
    "schemaVersion": {
      "const": "cg-gateway-event-0.1.0"
    },
    "sequence": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "claimBoundary",
    "decision",
    "enforcement",
    "eventHashSha256",
    "eventId",
    "eventType",
    "occurredAt",
    "policy",
    "previousEventHashSha256",
    "privacy",
    "request",
    "schemaVersion",
    "sequence"
  ],
  "title": "CapitalGuard tamper-evident gateway event",
  "type": "object"
}
