{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/conduyt-com/json-schema/conduyt-com-booking-documents-bind-envelope-schema.json",
  "title": "BookingDocumentsBindEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/conduyt-com-public-api-openapi.yml#/components/schemas/BookingDocumentsBindEnvelope",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/BookingDocumentsBind"
    }
  },
  "$defs": {
    "BookingDocumentRecord": {
      "type": "object",
      "required": [
        "pointer",
        "name",
        "kind",
        "size",
        "boundAt"
      ],
      "properties": {
        "pointer": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "bank_statement",
            "funding_agreement"
          ]
        },
        "size": {
          "type": "integer"
        },
        "boundAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "BookingDocumentSkip": {
      "type": "object",
      "required": [
        "pointer",
        "reason"
      ],
      "properties": {
        "pointer": {
          "type": "string"
        },
        "reason": {
          "type": "string",
          "enum": [
            "invalid_pointer",
            "invalid_kind",
            "duplicate",
            "limit",
            "upload_missing",
            "rejected",
            "pointer_in_use",
            "storage_unavailable",
            "budget"
          ]
        }
      }
    },
    "BookingDocumentsBind": {
      "type": "object",
      "required": [
        "attached",
        "skipped",
        "documents"
      ],
      "properties": {
        "attached": {
          "type": "integer",
          "description": "Documents attached by this call (a pointer already bound counts once)"
        },
        "skipped": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookingDocumentSkip"
          }
        },
        "documents": {
          "type": "array",
          "description": "Every document the booking holds after this call",
          "items": {
            "$ref": "#/$defs/BookingDocumentRecord"
          }
        }
      }
    }
  }
}