{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "JSON 7.0 common types definitions",
	"type": "object",
	"additionalProperties": false,
	"definitions": {
		"cityNumbers": {
			"type": "array",
			"minItems": 1,
			"items": {
				"additionalProperties": false,
				"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
			},
			"additionalProperties": false
		},
		"requestAuditInfo": {
			"description": "This holds the details about requestor and audit information",
			"type": "object",
			"properties": {
				"agentCode": {
					"description": "Unique reference used to identify the client to Miki",
					"type": "string",
					"minLength": 6,
					"maxLength": 6,
					"additionalProperties": false
				},
				"mikiInfo": {
					"additionalProperties": false,
					"description": "Please ignore, internal use only",
					"$ref": "#/definitions/xs:string"
				},
				"requestDateTime": {
					"additionalProperties": false,
					"description": "Time agent sent request to Miki",
					"$ref": "#/definitions/xs:dateTime"
				},
				"requestID": {
					"description": "Unique request reference used for audit purposes",
					"type": "integer",
					"maximum": 999999999,
					"additionalProperties": false
				},
				"requestPassword": {
					"description": "Daily password used to validate request",
					"type": "string",
					"maxLength": 50,
					"additionalProperties": false
				},
				"subAgentId": {
					"description": "Unique reference used to identify the subAgent to Miki client",
					"type": "integer",
					"minimum": 0,
					"additionalProperties": false
				},
				"userName": {
					"additionalProperties": false,
					"description": "UserName of the user submitting the request",
					"$ref": "#/definitions/xs:string"
				}
			},
			"required": [
				"agentCode",
				"requestDateTime",
				"requestID",
				"requestPassword"
			],
			"additionalProperties": false
		},
		"responseAuditInfo": {
			"description": "Standard audit information sent with all responses",
			"type": "object",
			"properties": {
				"agentCode": {
					"additionalProperties": false,
					"description": "Unique reference used to identify the client to Miki",
					"$ref": "#/definitions/xs:string"
				},
				"responseDateTime": {
					"additionalProperties": false,
					"description": "The time that the message was sent from Miki's server",
					"$ref": "#/definitions/xs:dateTime"
				},
				"responseID": {
					"description": "Miki reference used for audit purposes",
					"type": "integer",
					"additionalProperties": false
				},
				"subAgentId": {
					"description": "Unique reference used to identify the subAgent to Miki client",
					"type": "integer",
					"minimum": 0,
					"additionalProperties": false
				},
				"transactionID": {
					"additionalProperties": false,
					"description": "   Text fields to represent the unique id during the search.",
					"$ref": "#/definitions/xs:string"
				},
				"internalReference": {
					"type": "object"
				}
			},
			"required": [
				"agentCode",
				"responseDateTime",
				"responseID"
			],
			"additionalProperties": false
		},
		"warningType": {
			"description": "Used to conjunction with the success elements to define a business error",
			"type": "object",
			"properties": {
				"code": {
					"additionalProperties": false,
					"description": "Indicates the warning code.",
					"$ref": "#/definitions/xs:integer"
				},
				"description": {
					"additionalProperties": false,
					"description": "Detail description of the warning.",
					"$ref": "#/definitions/xs:string"
				},
				"solution": {
					"additionalProperties": false,
					"description": "Proposed solution to warning.",
					"$ref": "#/definitions/xs:string"
				}
			},
			"required": [
				"code",
				"description"
			],
			"additionalProperties": false
		},
		"warnings": {
			"description": "Indicates the collections of business level warning messages for requested products.",
			"type": "array",
			"minItems": 1,
			"items": {
				"$ref": "#/definitions/warningType"
			},
			"additionalProperties": false
		},
		"errorType": {
			"description": "Error content",
			"type": "object",
			"properties": {
				"Solution": {
					"description": "Proposed solution to error",
					"type": "string",
					"additionalProperties": false
				},
				"code": {
					"description": "Miki error code",
					"type": "integer",
					"additionalProperties": false
				},
				"description": {
					"description": "Full description of error",
					"type": "string",
					"additionalProperties": false
				}
			},
			"required": [
				"Solution",
				"code",
				"description"
			],
			"additionalProperties": false
		},
		"errors": {
			"description": "Indicates the collections of error occurred in the processing of the request message",
			"type": "array",
			"minItems": 1,
			"items": {
				"$ref": "#/definitions/errorType"
			},
			"additionalProperties": false
		},
		"alertType": {
			"description": "City level alerts",
			"type": "object",
			"properties": {
				"description": {
					"additionalProperties": false,
					"description": "Alert description",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"fromDate": {
					"additionalProperties": false,
					"description": "Alert valid from",
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"title": {
					"additionalProperties": false,
					"description": "Alert title",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"toDate": {
					"additionalProperties": false,
					"description": "Alert valid to",
					"$ref": "commonTypes.json#/definitions/xs:date"
				}
			},
			"required": [
				"description",
				"fromDate",
				"title",
				"toDate"
			],
			"additionalProperties": false
		},
		"stayPeriodRequestType": {
			"type": "object",
			"properties": {
				"checkinDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"checkoutDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"numberOfNights": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				}
			},
			"required": [
				"checkinDate"
			],
			"additionalProperties": false,
			"oneOf": [
				{
					"required": [
						"checkoutDate"
					]
				},
				{
					"required": [
						"numberOfNights"
					]
				}
			],
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.RequestStayPeriod"
		},
		"stayPeriodResponseType": {
			"type": "object",
			"properties": {
				"checkinDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"checkoutDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"numberOfNights": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:int"
				}
			},
			"required": [
				"checkinDate",
				"checkoutDate",
				"numberOfNights"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.ResponseStayPeriod"
		},
		"roomRestrictionType": {
			"description": "Restriction which are applicable to this room.",
			"type": "object",
			"properties": {
				"typeId": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"values": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"value": {
								"$ref": "commonTypes.json#/definitions/xs:string"
							},
							"id": {
								"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
							}
						},
						"required": [
							"id"
						],
						"additionalProperties": false,
						"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.RoomRestrictionValue"
					}
				}
			},
			"required": [
				"typeId"
			],
			"additionalProperties": false
		},
		"agentMarkupType": {
			"description": "Agent markup. Only for Miki internal use",
			"type": "object",
			"properties": {
				"amount": {
					"additionalProperties": false,
					"description": "Agent commission in numbers",
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"percentage": {
					"additionalProperties": false,
					"description": "Agent commission in percentage",
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				}
			},
			"additionalProperties": false
		},
		"roomRestrictionsType": {
			"description": "Restrictions which are applicable to this room.",
			"type": "array",
			"minItems": 1,
			"items": {
				"$ref": "#/definitions/roomRestrictionType"
			},
			"additionalProperties": false
		},
		"specialOfferType": {
			"description": "This needs to be changed based on the requirements",
			"type": "object",
			"properties": {
				"typeId": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"values": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"value": {
								"$ref": "commonTypes.json#/definitions/xs:string"
							},
							"id": {
								"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
							}
						},
						"required": [
							"id"
						],
						"additionalProperties": false,
						"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.SpecialOfferValue"
					}
				}
			},
			"required": [
				"typeId"
			],
			"additionalProperties": false
		},
		"specialOffers": {
			"description": "This optional element will be available only there are any special offers applied on the price",
			"type": "object",
			"properties": {
				"offersPresent": {
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				},
				"offers": {
					"type": "array",
					"items": {
						"$ref": "#/definitions/specialOfferType",
						"description": "This offer element contains all the details required to generate special offer description. This element will be present only when requested"
					}
				}
			},
			"required": [
				"offersPresent"
			],
			"additionalProperties": false
		},
		"taxType": {
			"type": "object",
			"properties": {
				"amount": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"description": {
					"additionalProperties": false,
					"description": "Description of the tax or fees",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"percentage": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				}
			},
			"required": [
				"description"
			],
			"additionalProperties": false
		},
		"taxesType": {
			"type": "array",
			"minItems": 1,
			"items": {
				"$ref": "#/definitions/taxType",
				"description": "An individual tax."
			},
			"additionalProperties": false
		},
		"mealBasisType": {
			"description": "Meal Basis Details",
			"type": "object",
			"properties": {
				"mealBasisCode": {
					"$ref": "commonTypes.json#/definitions/mealBasisCode"
				},
				"includedMeals": {
					"description": "Meal details. Mandatory  if mealBasisCode is not Room Only",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "commonTypes.json#/definitions/mealTypeGroup"
					},
					"additionalProperties": false
				}
			},
			"required": [
				"mealBasisCode"
			],
			"additionalProperties": false
		},
		"mealTypeGroup": {
			"type": "object",
			"properties": {
				"description": {
					"additionalProperties": false,
					"description": "Description of meal",
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"mealID": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:int"
				},
				"mealType": {
					"additionalProperties": false,
					"description": "1 - Breakfast, 2 = lunch, 3 = dinner",
					"$ref": "commonTypes.json#/definitions/xs:int"
				}
			},
			"required": [
				"mealID",
				"mealType"
			],
			"additionalProperties": false
		},
		"cancellationPolicyRecordType": {
			"type": "object",
			"properties": {
				"appliesFrom": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:dateTime"
				},
				"cancellationCharge": {
					"$ref": "#/definitions/cancellationCharge"
				},
				"fullStay": {
					"additionalProperties": false,
					"description": "Shows either cancellation charge percent should be applied to the whole stay or to the first night only",
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				}
			},
			"required": [
				"appliesFrom",
				"cancellationCharge",
				"fullStay"
			],
			"additionalProperties": false
		},
		"cancellationCharge": {
			"description": "Percentage of the first night amount or whole stay based on fullStay, or fixed amount.",
			"type": "object",
			"properties": {
				"amount": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				},
				"percentage": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				}
			},
			"additionalProperties": false,
			"oneOf": [
				{
					"required": [
						"amount"
					]
				},
				{
					"required": [
						"percentage"
					]
				}
			]
		},
		"availabilityStatusType": {
			"description": "Indicates the status of the availability. 1 - Available, 2 - OnRequest, 3- Unavailable",
			"type": "integer"
		},
		"productCodeType": {
			"additionalProperties": false,
			"description": "Unique reference to product",
			"$ref": "commonTypes.json#/definitions/xs:string"
		},
		"subproductCodeType": {
			"description": "Miki code representing room type or booking basis",
			"type": "string"
		},
		"currencyCodeType": {
			"description": "ISO currency code",
			"type": "string",
			"maxLength": 3
		},
		"countryCodeType": {
			"type": "string",
			"minLength": 2,
			"maxLength": 2
		},
		"passengerType": {
			"type": "string",
			"enum": [
				"ADT",
				"CHD"
			],
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.GuestType"
		},
		"TransactionStatusType": {
			"description": "Indicates the general Transaction status.",
			"type": "string",
			"enum": [
				"Pending",
				"Cancelled",
				"Ignored",
				"OnHold",
				"Unsuccessful",
				"Successful",
				"PendingCancellation",
				"Modification-Rejected",
				"Modified"
			]
		},
		"responseProductType": {
			"description": "Defined set of products",
			"type": "string",
			"minimum": -2147483648,
			"maximum": 2147483647,
			"enum": [
				"3",
				"4",
				"5"
			]
		},
		"serviceDate": {
			"type": "object",
			"properties": {
				"endDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				},
				"startDate": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:date"
				}
			},
			"required": [
				"startDate"
			],
			"additionalProperties": false
		},
		"xs:anyType": {
			"type": "string",
			"patternProperties": {
				"^@\\w+$": {
					"type": [
						"string",
						"number",
						"boolean"
					]
				},
				"^\\w+$": {}
			},
			"additionalProperties": false
		},
		"xs:boolean": {
			"description": "Shows either cancellation charge percent should be applied to the whole stay or to the first night only",
			"type": "boolean"
		},
		"xs:date": {
			"type": "string"
		},
		"xs:dateTime": {
			"type": "string"
		},
		"xs:decimal": {
			"type": "number"
		},
		"xs:double": {
			"type": "number"
		},
		"xs:int": {
			"type": "integer",
			"minimum": -2147483648,
			"maximum": 2147483647
		},
		"xs:integer": {
			"type": "integer"
		},
		"xs:language": {
			"type": "string",
			"pattern": "^([A-Za-z]{1,8}(\\-[0-9A-Za-z]{1,8})*)$"
		},
		"xs:nonNegativeInteger": {
			"type": "integer",
			"minimum": 0
		},
		"xs:positiveInteger": {
			"type": "integer",
			"minimum": 1
		},
		"xs:base64Binary": {
			"type": "base64Binary"
		},
		"xs:string": {
			"type": "string"
		},
		"xs:time": {
			"type": "string"
		},
		"mealBasisCode": {
			"type": "string",
			"minLength": 2,
			"maxLength": 2
		},
		"schemaVersion": {
			"type": "string",
			"enum": [
				"7.0"
			],
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.SchemaVersion"
		},
		"paxNameType": {
			"type": "object",
			"properties": {
				"title": {
					"description": "The title field is optional, as it is not applicable for certain languages",
					"type": "string"
				},
				"firstName": {
					"description": "The person's first name or initial",
					"type": "string"
				},
				"lastName": {
					"description": "The second name of the person",
					"type": "string"
				}
			},
			"required": [
				"firstName",
				"lastName"
			],
			"additionalProperties": false
		},
		"bookingGuestCountType": {
			"type": "object",
			"properties": {
				"guestCountType": {
					"$ref": "#/definitions/guestCountType"
				},
				"paxName": {
					"$ref": "#/definitions/paxNameType"
				}
			},
			"required": [
				"guestCountType"
			],
			"additionalProperties": false
		},
		"guestCountType": {
			"type": "object",
			"properties": {
				"type": {
					"description": "This attribute allows representing Adult, Child",
					"type": "string"
				},
				"age": {
					"description": "Defines the age of a guest.",
					"type": "number"
				}
			},
			"required": [
				"type"
			],
			"additionalProperties": false
		},
		"priceWithTaxes": {
			"description": "Type describing price with all taxes applicable if any.",
			"type": "object",
			"properties": {
				"price": {
					"type": "number"
				},
				"taxes": {
					"$ref": "#/definitions/taxesType"
				}
			},
			"required": [
				"price"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.PriceWithTaxes"
		},
		"priceType": {
			"type": "object",
			"properties": {
				"amount": {
					"type": "number"
				},
				"taxInclusive": {
					"type": "boolean"
				},
				"description": {
					"type": "string"
				}
			},
			"required": [
				"amount"
			],
			"additionalProperties": false
		},
		"payNowType": {
			"description": "Set the value as '1' for paying now, '0' for pay later",
			"type": "string",
			"enum": [
				"0",
				"1"
			]
		},
		"bookingReferenceType": {
			"description": "Unique reservation number for all the items in the nooking request.",
			"type": "string"
		},
		"immediateConfirmationRequired": {
			"description": "false=Booking can be made on request, true=Booking must be confirmed immediately",
			"type": "boolean"
		}
	}
}