{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aifinpay-io/json-schema/aifinpay-io-reporting-health-schema.json",
  "title": "ReportingHealth",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aifinpay-io-reporting-api-openapi.yml#/components/schemas/ReportingHealth",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "version": {
      "type": "integer",
      "const": 2
    },
    "producer_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-f-]{36}$"
    },
    "sequence": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,19})$"
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
    },
    "supported": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "access_challenged",
          "access_admitted",
          "resource_response_completed"
        ]
      },
      "maxItems": 3,
      "uniqueItems": true
    },
    "pending": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "dropped": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,19})$"
    },
    "retries": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,19})$"
    },
    "last_error": {
      "type": "string",
      "enum": [
        "none",
        "network",
        "timeout",
        "auth",
        "rejected",
        "storage",
        "queue_full",
        "retry_exhausted"
      ]
    }
  },
  "required": [
    "version",
    "producer_id",
    "sequence",
    "at",
    "supported",
    "pending",
    "dropped",
    "retries",
    "last_error"
  ]
}