{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eightfold-ai/json-schema/eightfold-ai-ext-booking-schema-schema.json",
  "title": "ExtBookingSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eightfold-ai-ext-booking-api-openapi.yml#/components/schemas/ExtBookingSchema",
  "type": "object",
  "properties": {
    "creatorEmail": {
      "type": "string",
      "description": "Email of the creator of the booking"
    },
    "createdAt": {
      "type": "integer",
      "format": "int32",
      "description": "Creation timestamp for the booking"
    },
    "bookingId": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Internal booking ID"
    },
    "startDateIso": {
      "type": "string",
      "description": "Start date of the booking in ISO format (YYYY-MM-DD)"
    },
    "endDateIso": {
      "type": "string",
      "description": "End date of the booking in ISO format (YYYY-MM-DD)"
    },
    "bookedCapacity": {
      "description": "Booked capacity of employee",
      "allOf": [
        {
          "$ref": "#/$defs/ExtBookingCapacityData"
        }
      ]
    },
    "lastModifiedAt": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Last modified timestamp for the booking"
    },
    "endDate": {
      "type": "integer",
      "format": "int32",
      "description": "[DEPRECATED] End date of the booking in epoch timestamp format. Use endDateIso instead."
    },
    "lastModifierEmail": {
      "type": [
        "string",
        "null"
      ],
      "description": "Email of the last modifier of the booking"
    },
    "extBookingId": {
      "type": "string",
      "description": "External booking id"
    },
    "startDate": {
      "type": "integer",
      "format": "int32",
      "description": "[DEPRECATED] Start date of the booking in epoch timestamp format. Use startDateIso instead."
    },
    "extDemandId": {
      "type": [
        "string",
        "null"
      ],
      "description": "External demand id for the demand associated with the booking"
    },
    "employeeId": {
      "type": "string",
      "description": "Employee id"
    },
    "bookingStatus": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected"
      ],
      "description": "Status of the booking. Possible values: ['pending', 'approved', 'rejected']"
    },
    "bookingType": {
      "type": "string",
      "enum": [
        "demand",
        "leave",
        "optional_holiday",
        "blocker"
      ],
      "description": "Type of the booking. Possible values: ['demand', 'leave', 'optional_holiday', 'blocker']"
    }
  },
  "required": [
    "bookingStatus",
    "bookingType",
    "createdAt",
    "creatorEmail",
    "employeeId",
    "extBookingId"
  ],
  "$defs": {
    "ExtBookingCapacityData": {
      "type": "object",
      "properties": {
        "unit": {
          "type": "string",
          "enum": [
            "hours",
            "percentage",
            "fraction"
          ],
          "description": "Unit of capacity. Possible values: ['hours', 'percentage', 'fraction']"
        },
        "timeGranularity": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "daily",
            "weekly",
            "monthly"
          ],
          "description": "Time granularity of capacity. Possible values: ['daily', 'weekly', 'monthly']"
        },
        "capacity": {
          "type": "number",
          "format": "float",
          "description": "Capacity value"
        }
      },
      "required": [
        "capacity",
        "unit"
      ]
    }
  }
}