{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "JSON 7.0 booking common types definitions",
	"type": "object",
	"additionalProperties": false,
	"definitions": {
		"prebookRoomOptionType": {
			"type": "object",
			"properties": {
				"roomNo": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"roomTypeCode": {
					"$ref": "commonTypes.json#/definitions/subproductCodeType"
				},
				"cancellationPolicies": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "commonTypes.json#/definitions/cancellationPolicyRecordType"
					},
					"additionalProperties": false
				},
				"guests": {
					"description": "Collection of room stay candidate.",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "bookingCommonTypes.json#/definitions/bookingGuestCountType",
						"description": "Each roomBasis needs to be specified with a sequence, number of adults and number of children."
					},
					"additionalProperties": false
				},
				"rateIdentifier": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"roomTotalPrice": {
					"$ref": "#/definitions/priceWithTaxes",
					"description": "Total price for all quantity of this subProduct and for all nights"
				}
			},
			"required": [
				"roomNo",
				"roomTypeCode", 
				"cancellationPolicies", 
				"guests", 
				"roomTotalPrice"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookResponseRoom"
		},
		"prebookRoomOptionTypeResponse": {
			"type": "object",
			"properties": {
				"roomNo": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"roomTypeCode": {
					"$ref": "commonTypes.json#/definitions/subproductCodeType"
				},
				"cancellationPolicies": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "commonTypes.json#/definitions/cancellationPolicyRecordType"
					},
					"additionalProperties": false
				},
				"dates": {
					"description": "This element holds the price breakdown",
					"type": "array",
					"minItems": 0,
					"items": {
						"$ref": "#/definitions/prebookDateType"
					},
					"additionalProperties": false
				},				
				"rateIdentifier": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"roomTotalPrice": {
					"$ref": "#/definitions/priceWithTaxes",
					"description": "Total price for all quantity of this subProduct and for all nights"
				},
				"rateDetails": {
					"additionalProperties": false,
					"description": "Rate details.",
					"items": {
						"additionalProperties": false,
						"$ref": "commonTypes.json#/definitions/xs:string"
					},
					"minItems": 0,
					"type": "array"
				}				
			},
			"required": [
				"roomNo",
				"roomTypeCode", 
				"cancellationPolicies", 
				"guests", 
				"roomTotalPrice"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookResponseRoom"
		},
		"prebookDateType": {
			"description": "This element holds the price breakdown per service date",
			"type": "object",
			"properties": {
				"serviceDate": {
					"$ref": "commonTypes.json#/definitions/xs:date"
				},				
				"dailyPrice": {
					"$ref": "#/definitions/prebookDailyPriceType",
					"description": "Price per sub product"
				}
			},
			"required": [
				"serviceDate", 
				"dailyPrice"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookDateType"
		},
		"prebookDailyPriceType": {
			"type": "object",
			"properties": {
				"commissionAmount": {
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"commissionRate": {
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"priceType": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"price": {
					"type": "object",
					"properties": {
						"value": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						},
						"recommendedSellingPrice": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						}
					},
					"additionalProperties": false,
					"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookResponsePrice"
				},
				"taxes": {
					"$ref": "commonTypes.json#/definitions/taxesType"
				}
			},
			"required": [
				"priceType", 
				"price"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookDailyPriceType"
		},				
		"bookingRoomOptionType": {
			"type": "object",
			"properties": {
				"extraBed": {
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				},
				"roomNo": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"roomTypeCode": {
					"$ref": "commonTypes.json#/definitions/subproductCodeType"
				},
				"availabilityStatus": {
					"additionalProperties": false,
					"description": "This value indicates the overall availability (considering all nights of the stay if hotel): 1=Available, 2=On request",
					"$ref": "commonTypes.json#/definitions/availabilityStatusType"
				},
				"cancellationPolicies": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "commonTypes.json#/definitions/cancellationPolicyRecordType"
					},
					"additionalProperties": false
				},
				"dates": {
					"description": "This element holds the price breakdown",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "#/definitions/bookingDateType"
					},
					"additionalProperties": false
				},
				"guests": {
					"description": "Collection of room stay candidate.",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "bookingCommonTypes.json#/definitions/bookingGuestCountType",
						"description": "Each roomBasis needs to be specified with a sequence, number of adults and number of children."
					},
					"additionalProperties": false
				},
				"rateIdentifier": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"roomCategory": {
					"additionalProperties": false,
					"description": "Room category ID",
					"$ref": "commonTypes.json#/definitions/xs:integer"
				},
				"roomDescription": {
					"additionalProperties": false,
					"description": "Room description",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"rateDetails": {
					"additionalProperties": false,
					"description": "Rate details.",
					"items": {
						"additionalProperties": false,
						"$ref": "commonTypes.json#/definitions/xs:string"
					},
					"minItems": 0,
					"type": "array"
				},
				"roomRestrictions": {
					"$ref": "commonTypes.json#/definitions/roomRestrictionsType"
				},
				"roomTotalPrice": {
					"$ref": "#/definitions/priceWithTaxes",
					"description": "Total price for all quantity of this subProduct and for all nights"
				},
				"specialOffers": {
					"$ref": "commonTypes.json#/definitions/specialOffers"
				},
				"supplierName": {
					"additionalProperties": false,
					"description": "Details to identify the supplier",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"transactionID": {
					"additionalProperties": false,
					"description": "Unique id from search response.",
					"$ref": "commonTypes.json#/definitions/xs:string"
				}
			},
			"required": [
				"roomNo",
				"roomTypeCode", 
				"availabilityStatus", 
				"cancellationPolicies", 
				"dates", 
				"guests", 
				"roomDescription", 
				"roomTotalPrice"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingResponseRoom"
		},
		"bookingDateType": {
			"description": "This element holds the price breakdown per service date",
			"type": "object",
			"properties": {
				"serviceDate": {
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"dailyPrice": {
					"$ref": "#/definitions/bookDailyPriceType",
					"description": "Price per sub product"
				},
				"mealBasis": {
					"$ref": "commonTypes.json#/definitions/mealBasisType",
					"description": "Meal Basis Details"
				}
			},
			"required": [
				"serviceDate", 
				"dailyPrice", 
				"mealBasis"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingDateType"
		},
		"bookDailyPriceType": {
			"type": "object",
			"properties": {
				"commissionAmount": {
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"commissionRate": {
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"priceType": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"price": {
					"type": "object",
					"properties": {
						"value": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						},
						"recommendedSellingPrice": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						}
					},
					"additionalProperties": false,
					"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingResponsePrice"
				},
				"taxes": {
					"$ref": "commonTypes.json#/definitions/taxesType"
				}
			},
			"required": [
				"priceType", 
				"price"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookDailyPriceType"
		},
		"prebookGuestCountType": {
			"type": "object",
			"properties": {
				"age": {
					"additionalProperties": false,
					"description": "Defines the age of a guest.",
					"$ref": "commonTypes.json#/definitions/xs:nonNegativeInteger"
				},
				"type": {
					"additionalProperties": false,
					"description": "This attribute allows representing Adult, Child",
					"$ref": "commonTypes.json#/definitions/passengerType"
				}
			},
			"required": [
				"type"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PrebookGuest"
		},		
		"bookingGuestCountType": {
			"type": "object",
			"properties": {
				"age": {
					"additionalProperties": false,
					"description": "Defines the age of a guest.",
					"$ref": "commonTypes.json#/definitions/xs:nonNegativeInteger"
				},
				"paxName": {
					"$ref": "bookingCommonTypes.json#/definitions/paxNameType"
				},
				"type": {
					"additionalProperties": false,
					"description": "This attribute allows representing Adult, Child",
					"$ref": "commonTypes.json#/definitions/passengerType"
				}
			},
			"required": [
				"paxName", 
				"type"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingGuest"
		},
		"paymentResponseType": {
			"type": "object",
			"properties": {
				"authorizationCode": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"success": {
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				},
				"type": {
					"$ref": "#/definitions/paymentTransactionType"
				},
				"amount": {
					"description": "Indicates the Total transaction amount .",
					"type": "object",
					"properties": {
						"amount": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						},
						"description": {
							"$ref": "commonTypes.json#/definitions/xs:string"
						},
						"taxInclusive": {
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						}
					},
					"required": [
						"amount"
					],
					"additionalProperties": false
				},
				"errors": {
					"$ref": "commonTypes.json#/definitions/errors",
					"description": "Collection of the erros from the Payment service provider if any error happen during transaction."
				}
			},
			"required": [
				"success", 
				"type"
			],
			"additionalProperties": false
		},
		"paymentTransactionType": {
			"description": "The defined set of the payment transactions",
			"type": "string",
			"minimum": -2147483648,
			"maximum": 2147483647,
			"enum": [
				"1",
				"2"
			]
		},
		"paxNameType": {
			"description": "Contains the Lead passenger details.",
			"type": "object",
			"properties": {
				"firstName": {
					"description": "The person's first name or initial",
					"type": "string",
					"minLength": 1,
					"maxLength": 100,
					"additionalProperties": false
				},
				"lastName": {
					"description": "The second name of the person",
					"type": "string",
					"minLength": 1,
					"maxLength": 100,
					"additionalProperties": false
				},
				"title": {
					"description": "The title field is optional, as it is not applicable for certain languages",
					"type": "string",
					"maxLength": 10,
					"additionalProperties": false
				}
			},
			"required": [
				"firstName", 
				"lastName"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PaxName"
		},
		"preferencesType": {
			"description": "Optional preferences are non-guarantered requests that we will forward to the hotel",
			"type": "object",
			"properties": {
				"paxPreferences": {
					"type": "object",
					"properties": {
						"checkIn": {
							"type": "object",
							"properties": {
								"early": {
									"type": "object",
									"properties": {
										"checkInTime": {
											"$ref": "commonTypes.json#/definitions/xs:time"
										}
									},
									"required": [
										"checkInTime"
									],
									"additionalProperties": false,
									"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.EarlyCheckIn"
								},
								"late": {
									"type": "object",
									"properties": {
										"checkInTime": {
											"$ref": "commonTypes.json#/definitions/xs:time"
										}
									},
									"required": [
										"checkInTime"
									],
									"additionalProperties": false
								}
							},
							"additionalProperties": false
						},
						"checkOut": {
							"type": "object",
							"properties": {
								"early": {
									"type": "object",
									"properties": {
										"checkOutTime": {
											"$ref": "commonTypes.json#/definitions/xs:time"
										}
									},
									"required": [
										"checkOutTime"
									],
									"additionalProperties": false,
									"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.EarlyCheckOut"
								}
							},
							"required": [
								"early"
							],
							"additionalProperties": false
						},
						"flightNumber": {
							"type": "string",
							"maxLength": 10,
							"additionalProperties": false
						},
						"flightTime": {
							"additionalProperties": false,
							"$ref": "commonTypes.json#/definitions/xs:time"
						},
						"frequentGuestNumber": {
							"additionalProperties": false,
							"$ref": "commonTypes.json#/definitions/xs:string"
						},
						"paxOnHoneymoon": {
							"additionalProperties": false,
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"vipPax": {
							"additionalProperties": false,
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						}
					},
					"additionalProperties": true
				},
				"roomPreferences": {
					"type": "object",
					"properties": {
						"adjoiningRooms": {
							"additionalProperties": false,
							"description": "Adjoingin rooms preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"aircon": {
							"additionalProperties": false,
							"description": "Air conditioning in room preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"bathTub": {
							"additionalProperties": false,
							"description": "Bathtub preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"floor": {
							"description": "Preferred floor: 0=Any, 1=Ground, 2=Middle, 3=High",
							"type": "string",
							"additionalProperties": false,
							"enum": [
								"0", 
								"1", 
								"2", 
								"3"
							]
						},
						"nonSmoking": {
							"additionalProperties": false,
							"description": "Non-smoking room preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"separateBeds": {
							"additionalProperties": false,
							"description": "Separate beds preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						},
						"smokingRoom": {
							"additionalProperties": false,
							"description": "Smoking room preferred: 0=No, 1=Yes",
							"$ref": "commonTypes.json#/definitions/xs:boolean"
						}
					},
					"additionalProperties": true
				}
			},
			"additionalProperties": true
		},
		"priceWithTaxes": {
			"description": "Type describing price with all taxes applicable if any.",
			"type": "object",
			"properties": {
				"price": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"taxes": {
					"$ref": "commonTypes.json#/definitions/taxesType"
				}
			},
			"required": [
				"price"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PriceWithTaxes"
		},
		"priceType": {
			"description": "Define the amount.",
			"type": "object",
			"properties": {
				"amount": {
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"description": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"taxInclusive": {
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				}
			},
			"required": [
				"amount"
			],
			"additionalProperties": false
		},
		"tourReferenceType": {
			"description": "This is a unique reservation number for this item.",
			"type": "string"
		},
		"clientReferenceType": {
			"description": "This field can be used to hold the client's reference for the booking",
			"type": "object",
			"properties": {
				"value": {
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"mustBeUnique": {
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				}
			},
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.ClientRef"
		},
		"bookingStatusType": {
			"description": "Tour status: 25=On request, 30=Confirmed, 70=Rejected, 90=Cancelled, 99=Error",
			"type": "string",
			"enum": [
				"10", 
				"25", 
				"30", 
				"65", 
				"70", 
				"90", 
				"99"
			],
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingStatus"
		},
		"paymentStatusType": {
			"description": "The defined set of the payment status of the Booking",
			"type": "string",
			"minimum": -2147483648,
			"maximum": 2147483647,
			"enum": [
				"0", 
				"10", 
				"25", 
				"40", 
				"90", 
				"99"
			]
		},
		"paymentRequestType": {
			"type": "object",
			"properties": {
				"cardCVV": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"cardExpiryDateMonth": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:integer"
				},
				"cardExpiryDateYear": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:integer"
				},
				"cardHolderName": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"cardNumber": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"cardStartDateMonth": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:integer"
				},
				"cardStartDateYear": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:integer"
				},
				"cardType": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				}
			},
			"required": [
				"cardCVV", 
				"cardExpiryDateMonth", 
				"cardExpiryDateYear", 
				"cardHolderName", 
				"cardNumber", 
				"cardType"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PaymentCard"
		},
		"cancellationDetailType": {
			"description": "to be populated when a booking is cancellled",
			"type": "object",
			"properties": {
				"cancellationCharge": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"cancellationChargeCurrency": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"cancellationDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"cancellationReference": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				}
			},
			"additionalProperties": false
		}
	}
}