{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/the-driscoll-com/json-schema/the-driscoll-com-availability-document-schema.json",
  "title": "AvailabilityDocument",
  "description": "Indicative stay availability and nightly rates for The Driscoll. Availability and pricing are separate: a published rate does not make a date available. This feed is not a booking engine and does not provide a final guest total or guarantee that a stay can be reserved.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/the-driscoll-com-openapi.json#/components/schemas/AvailabilityDocument",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "property",
    "timeZone",
    "availabilityGranularity",
    "checkinTime",
    "checkoutTime",
    "sameDayTurnoverAllowed",
    "rangeSemantics",
    "adjacentRangesMustNotBeMerged",
    "coverageStartsAt",
    "coverageEndsAt",
    "generatedAt",
    "validUntil",
    "feedStatus",
    "availabilityIsIndicative",
    "directBooking",
    "bookingVerificationRequired",
    "minimumStayNights",
    "maximumStayNights",
    "availableStayRanges",
    "pricing",
    "bookingConstraints"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.3",
      "description": "Version of this availability-feed schema."
    },
    "property": {
      "$ref": "#/$defs/PropertyReference"
    },
    "timeZone": {
      "type": "string",
      "const": "Australia/Sydney",
      "description": "IANA time-zone identifier used for all stay times."
    },
    "availabilityGranularity": {
      "type": "string",
      "const": "stay",
      "description": "Availability is expressed as complete stay windows, not independent available dates."
    },
    "checkinTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$",
      "description": "Local check-in time."
    },
    "checkoutTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$",
      "description": "Local check-out time."
    },
    "sameDayTurnoverAllowed": {
      "type": "boolean",
      "description": "Whether one stay may check out on the same local date that another stay checks in."
    },
    "rangeSemantics": {
      "type": "string",
      "const": "earliestCheckIn and latestCheckOut bound one stay window; a stay must fit wholly within one published range",
      "description": "Authoritative interpretation of each published availability range."
    },
    "adjacentRangesMustNotBeMerged": {
      "type": "boolean",
      "const": true,
      "description": "Separate availability ranges must be evaluated independently and never combined."
    },
    "coverageStartsAt": {
      "type": "string",
      "format": "date-time",
      "description": "Beginning of the period assessed by the feed, including its UTC offset."
    },
    "coverageEndsAt": {
      "type": "string",
      "format": "date-time",
      "description": "End of the period assessed by the feed, including its UTC offset."
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time at which this feed document was generated."
    },
    "validUntil": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time after which consumers must retrieve a fresh document."
    },
    "feedStatus": {
      "type": "string",
      "const": "current",
      "description": "Freshness or operational status reported by the publisher."
    },
    "availabilityIsIndicative": {
      "type": "boolean",
      "const": true,
      "description": "Availability is indicative rather than a reservation guarantee."
    },
    "directBooking": {
      "type": "boolean",
      "const": false,
      "description": "This endpoint cannot create a direct booking."
    },
    "bookingVerificationRequired": {
      "type": "boolean",
      "const": true,
      "description": "Availability and pricing must be verified through an authorised booking platform."
    },
    "minimumStayNights": {
      "type": "integer",
      "minimum": 1,
      "description": "Property-wide baseline only. Use the greater of this value and the selected channel's current arrival-date minimumStayNights in bookingConstraints.channels[].dateRules. A three-night free window with a three-night arrival minimum permits only its complete three-night stay; it does not permit a two-night subset."
    },
    "maximumStayNights": {
      "type": "integer",
      "minimum": 1,
      "description": "Published maximum stay length in nights."
    },
    "availableStayRanges": {
      "type": "array",
      "description": "Independent windows in which a complete stay may fit. A check-in and check-out must fall within the same array item. Do not merge adjacent items.",
      "items": {
        "$ref": "#/$defs/AvailableStayRange"
      }
    },
    "pricing": {
      "$ref": "#/$defs/Pricing"
    },
    "bookingConstraints": {
      "$ref": "#/$defs/BookingConstraints"
    }
  },
  "$defs": {
    "AvailableStayRange": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "earliestCheckIn",
        "latestCheckOut"
      ],
      "properties": {
        "earliestCheckIn": {
          "type": "string",
          "format": "date-time",
          "description": "Earliest permitted check-in at the beginning of this independent stay window."
        },
        "latestCheckOut": {
          "type": "string",
          "format": "date-time",
          "description": "Latest permitted check-out at the end of this independent stay window."
        }
      }
    },
    "BookingConstraintChannel": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "channel",
        "generatedAt",
        "validUntil",
        "dateRules"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "airbnb",
            "stayz"
          ]
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "validUntil": {
          "type": "string",
          "format": "date-time"
        },
        "dateRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookingDateRule"
          }
        }
      }
    },
    "BookingConstraints": {
      "type": "object",
      "description": "Optional public date-specific booking rules needed to assess a proposed stay. They do not expose private reservation or pricing-system data.",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "status",
        "channels"
      ],
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "1.0"
        },
        "status": {
          "type": "string",
          "enum": [
            "current",
            "unavailable_or_stale"
          ]
        },
        "channels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookingConstraintChannel"
          }
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "const": "current"
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "properties": {
              "channels": {
                "minItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "unavailable_or_stale"
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "properties": {
              "channels": {
                "maxItems": 0
              }
            }
          }
        }
      ]
    },
    "BookingDateRule": {
      "type": "object",
      "description": "A public date-specific rule that affects stay eligibility.",
      "additionalProperties": false,
      "required": [
        "stayDate"
      ],
      "properties": {
        "stayDate": {
          "type": "string",
          "format": "date"
        },
        "minimumStayNights": {
          "type": "integer",
          "minimum": 1
        },
        "checkInAllowed": {
          "type": "boolean"
        },
        "checkOutAllowed": {
          "type": "boolean"
        }
      }
    },
    "DailyRate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "stayDate",
        "nightlyRate"
      ],
      "properties": {
        "stayDate": {
          "type": "string",
          "format": "date",
          "description": "Local accommodation night to which the rate applies."
        },
        "nightlyRate": {
          "type": "number",
          "minimum": 0,
          "description": "Indicative nightly amount in the pricing object's currency."
        }
      }
    },
    "Pricing": {
      "type": "object",
      "description": "Optional nightly-rate publication carried inside every availability document. Its status is independent of the availability feed status. When pricing is unavailable or stale, rates is empty.",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "status",
        "rateUnit",
        "priceType",
        "finalGuestTotal",
        "finalPriceVerificationRequired",
        "ratePresenceDoesNotImplyAvailability",
        "rates"
      ],
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "1.1",
          "description": "Version of the nested pricing schema."
        },
        "status": {
          "type": "string",
          "enum": [
            "current",
            "unavailable_or_stale"
          ],
          "description": "Whether current public pricing data is present."
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "ISO 4217 currency code. Present when status is current."
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time at which the public rate snapshot was generated. Present when status is current."
        },
        "validUntil": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time after which the rates must not be treated as current. Present when status is current."
        },
        "rateUnit": {
          "type": "string",
          "const": "night",
          "description": "Each published rate applies to one accommodation night."
        },
        "priceType": {
          "type": "string",
          "const": "indicative_nightly_rate",
          "description": "The amount is an indicative nightly rate, not a final platform price."
        },
        "finalGuestTotal": {
          "type": "boolean",
          "const": false,
          "description": "The feed does not publish a final guest total."
        },
        "finalPriceVerificationRequired": {
          "type": "boolean",
          "const": true,
          "description": "The final price must be checked on the authorised booking platform."
        },
        "ratePresenceDoesNotImplyAvailability": {
          "type": "boolean",
          "const": true,
          "description": "A rate may exist for a date that is not available. Consumers must assess availableStayRanges separately."
        },
        "rates": {
          "type": "array",
          "description": "Nightly amounts. Empty when pricing is unavailable or stale.",
          "items": {
            "$ref": "#/$defs/DailyRate"
          }
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "const": "current"
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "required": [
              "currency",
              "generatedAt",
              "validUntil"
            ],
            "properties": {
              "rates": {
                "minItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "unavailable_or_stale"
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "properties": {
              "rates": {
                "maxItems": 0
              }
            }
          }
        }
      ]
    },
    "PropertyReference": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "@id",
        "name"
      ],
      "properties": {
        "@id": {
          "type": "string",
          "format": "uri",
          "const": "https://the-driscoll.com/stay/#vacationrental",
          "description": "Canonical structured-data identifier for the property."
        },
        "name": {
          "type": "string",
          "const": "The Driscoll on Fitzroy",
          "description": "Public property name."
        }
      }
    }
  }
}