{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-actual-delivery-windows-schema.json",
  "title": "Collection of actual delivery windows",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-delivery-windows-api-openapi.yml#/components/schemas/ActualDeliveryWindows",
  "type": "array",
  "items": {
    "$ref": "#/$defs/ActualDeliveryWindow"
  },
  "$defs": {
    "ActualDeliveryWindow": {
      "title": "Actual delivery window",
      "description": "Delivery window is a range of times when the shipment can be delivered to the customers.",
      "type": "object",
      "properties": {
        "id": {
          "description": "Delivery window’s unique identifier.",
          "type": "string"
        },
        "deliveryDate": {
          "description": "Delivery date compliant with the ISO 8601 standard.",
          "type": "string"
        },
        "deliveryTimeRange": {
          "$ref": "#/$defs/TimeRange"
        },
        "deliveryCycle": {
          "description": "Delivery cycle.",
          "type": "string"
        },
        "zoneId": {
          "description": "Delivery zone’s unique identifier.",
          "type": "string"
        },
        "deliveryMethod": {
          "description": "Delivery method name.",
          "type": "string"
        },
        "cutOffTime": {
          "description": "This denotes the latest point in time by which an action (such as an order or request) must be completed for a specific Delivery Time. Date is compliant with the ISO 8601 standard.",
          "type": "string"
        },
        "slotId": {
          "description": "Delivery time slot's unique identifier.",
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/MetaData"
        }
      },
      "required": [
        "deliveryDate"
      ]
    },
    "MetaData": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": "string",
          "description": "Date and time when the object was created, compliant with the ISO 8601 format.",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"
        },
        "modifiedAt": {
          "type": "string",
          "description": "Date and time when the object was last modified, compliant with the ISO 8601 format.",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"
        },
        "version": {
          "minimum": 1,
          "type": "integer"
        }
      }
    },
    "TimeRange": {
      "title": "Time range",
      "description": "A `from` to `to` time range for which the object is valid",
      "type": "object",
      "properties": {
        "startTime": {
          "pattern": "^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$",
          "type": "string",
          "description": "Time from which the object is valid, provided in local time (e.g. 10:00)"
        },
        "endTime": {
          "pattern": "^(2[0-4]|[01]?[0-9]):([0-5]?[0-9])$",
          "type": "string",
          "description": "Time to which the object is valid, provided in local time (e.g. 10:00)."
        }
      },
      "required": [
        "startTime",
        "endTime"
      ]
    }
  }
}