{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "Hotel booking response JSON schema",
	"additionalProperties": false,
	"definitions": {
		"bookingSearchResponse": {
			"additionalProperties": false,
			"description": "Generic service to return the list of bookings which are satisfying the search criteria.",
			"properties": {
				"versionNumber": {
					"$ref": "commonTypes.json#/definitions/schemaVersion"
				},
				"bookingItems": {
					"additionalProperties": false,
					"description": "Collection of booking items which are satisfying the search response.",
					"items": {
						"$ref": "#/definitions/bookingSearchResponseItemType"
					},
					"minItems": 1,
					"type": "array"
				},
				"errors": {
					"$ref": "commonTypes.json#/definitions/errors",
					"description": "Collection of errors happen during the reservation of items."
				},
				"responseAuditInfo": {
					"$ref": "commonTypes.json#/definitions/responseAuditInfo",
					"description": "This holds the details about requestor and audit information."
				},
				"warnings": {
					"$ref": "commonTypes.json#/definitions/warnings"
				}
			},
			"required": [
				"responseAuditInfo", "versionNumber"
			],
			"oneOf": [
				{
					"required": [
						"bookingItems"
					]
				},
				{
					"required": [
						"errors"
					]
				}
			],
			"type": "object"
		},
		"bookingSearchResponseItemType": {
			"additionalProperties": false,
			"description": "The Detail of the booking item",
			"properties": {
				"allowModifications": {
					"$ref": "commonTypes.json#/definitions/xs:nonNegativeInteger"
				},
				"bookingReference": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"clientRef": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"currencyCode": {
					"$ref": "commonTypes.json#/definitions/currencyCodeType"
				},
				"paymentDueDate": {
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"paymentStatus": {
					"$ref": "bookingCommonTypes.json#/definitions/paymentStatusType"
				},
				"status": {
					"$ref": "bookingCommonTypes.json#/definitions/bookingStatusType"
				},
				"supplierReservationReference": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"tourReference": {
					"$ref": "bookingCommonTypes.json#/definitions/tourReferenceType"
				},
				"commission": {
					"$ref": "bookingCommonTypes.json#/definitions/priceType",
					"description": "Total subagent dynamic markup price for the booking requested"
				},
				"createdBy": {
					"additionalProperties": false,
					"description": "The booking creater details",
					"properties": {
						"createDateTime": {
							"$ref": "commonTypes.json#/definitions/xs:date"
						},
						"branchCode": {
							"additionalProperties": false,
							"description": "Branch Code",
							"maxLength": 3,
							"minLength": 3,
							"type": "string"
						},
						"clientCode": {
							"additionalProperties": false,
							"description": "Client code",
							"maxLength": 3,
							"minLength": 3,
							"type": "string"
						},
						"profitCenter": {
							"additionalProperties": false,
							"description": "Profit center",
							"$ref": "#/definitions/profitCentreType"
						},
						"userName": {
							"additionalProperties": false,
							"description": "User name of the client",
							"$ref": "commonTypes.json#/definitions/xs:string"
						}
					},
					"type": "object"
				},
				"departureDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"giataCode": {
					"$ref": "commonTypes.json#/definitions/xs:anyType"
				},
				"hotel": {
					"additionalProperties": false,
					"description": "This will be added only when returning full hotel booking details",
					"properties": {
						"alerts": {
							"additionalProperties": false,
							"description": "Collection of alert messages which are specific to this room",
							"items": {
								"$ref": "commonTypes.json#/definitions/alertType"
							},
							"minItems": 1,
							"type": "array"
						},
						"preferences": {
							"$ref": "bookingCommonTypes.json#/definitions/preferencesType"
						},
						"rooms": {
							"additionalProperties": false,
							"items": {
								"$ref": "bookingCommonTypes.json#/definitions/bookingRoomOptionType"
							},
							"minItems": 1,
							"type": "array"
						},
						"specialRequest": {
							"additionalProperties": false,
							"description": "Confirmation of the special request",
							"$ref": "commonTypes.json#/definitions/xs:string"
						},
						"stayPeriod": {
							"$ref": "commonTypes.json#/definitions/stayPeriodResponseType",
							"description": "Service Date Range "
						}
					},
					"required": [
						"stayPeriod"
					],
					"type": "object",
					"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingSearchHotel"
				},
				"itemTotalPrice": {
					"$ref": "bookingCommonTypes.json#/definitions/priceWithTaxes",
					"description": "Total price for all items on the booking"
				},
				"lastUpdated": {
					"additionalProperties": false,
					"description": "The details of the Last modification. ",
					"properties": {
						"lastUpdatedDateTime": {
							"$ref": "commonTypes.json#/definitions/xs:date"
						},
						"branchCode": {
							"additionalProperties": false,
							"description": "Branch Code",
							"maxLength": 3,
							"minLength": 3,
							"type": "string"
						},
						"clientCode": {
							"additionalProperties": false,
							"description": "Client code",
							"maxLength": 3,
							"minLength": 3,
							"type": "string"
						},
						"profitCenter": {
							"additionalProperties": false,
							"description": "Profit center",
							"$ref": "#/definitions/profitCentreType"
						},
						"userName": {
							"additionalProperties": false,
							"description": "User name of the client",
							"$ref": "commonTypes.json#/definitions/xs:string"
						}
					},
					"type": "object"
				},
				"leadPaxName": {
					"$ref": "bookingCommonTypes.json#/definitions/paxNameType"
				},
				"paymentInfo": {
					"$ref": "bookingCommonTypes.json#/definitions/paymentResponseType"
				},
				"productCode": {
					"$ref": "commonTypes.json#/definitions/productCodeType",
					"description": "Unique reference to product"
				},
				"productType": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/responseProductType"
				},
				"serviceDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/serviceDate"
				},
				"cancellationDetail": {"additionalProperties": false,
				"$ref": "bookingCommonTypes.json#/definitions/cancellationDetailType"}
			},
			"required": [
				"createdBy", "itemTotalPrice", "lastUpdated", "leadPaxName", "productCode", "productType", "serviceDate", "currencyCode", "tourReference", "status", "allowModifications", "bookingReference"
			],
			"type": "object"
		},
		"profitCentreType": {
			"maxLength": 3,
			"minLength": 3,
			"type": "string"
		}
	},
	"type": "object",
	"$ref": "#/definitions/bookingSearchResponse"
}