{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fleetkeep-co-uk/json-schema/fleetkeep-co-uk-booking-envelope-schema.json",
  "title": "BookingEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fleetkeep-co-uk-bookings-api-openapi.yml#/components/schemas/BookingEnvelope",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "booking"
  ],
  "properties": {
    "booking": {
      "$ref": "#/$defs/Booking"
    },
    "replay": {
      "type": "boolean"
    }
  },
  "$defs": {
    "Booking": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "maintenanceEventId",
        "vehicleId",
        "productCategory",
        "taskType",
        "taskTitle",
        "preferredPostcode",
        "preferredDate",
        "preferredGarage",
        "garageEmail",
        "garagePhone",
        "garageWebsite",
        "notes",
        "status",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "maintenanceEventId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "vehicleId": {
          "type": "string",
          "format": "uuid"
        },
        "productCategory": {
          "type": "string",
          "maxLength": 32
        },
        "taskType": {
          "type": "string",
          "maxLength": 80
        },
        "taskTitle": {
          "type": "string",
          "maxLength": 160
        },
        "preferredPostcode": {
          "type": "string",
          "maxLength": 80
        },
        "preferredDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "preferredGarage": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 160
        },
        "garageEmail": {
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "garagePhone": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 80
        },
        "garageWebsite": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 300
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1200
        },
        "status": {
          "type": "string",
          "maxLength": 32
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}