{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/silvercar/json-schema/silvercar-failed-customer-notification-schema.json",
  "title": "FailedCustomerNotification",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/silvercar-admin-api-openapi.yml#/components/schemas/FailedCustomerNotification",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "reservation_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "customer_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "location_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "message_type": {
      "type": "string"
    },
    "channel": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "attempt_count": {
      "type": "integer"
    },
    "replay_count": {
      "type": "integer"
    },
    "last_error_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_error_message": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_failed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "latest_attempt": {
      "$ref": "#/$defs/CustomerNotificationAttempt"
    }
  },
  "$defs": {
    "CustomerNotificationAttempt": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "attempt_number": {
          "type": "integer"
        },
        "provider": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "provider_message_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "error_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "error_message": {
          "type": [
            "string",
            "null"
          ]
        },
        "requested_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "callback_received_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}