Мастер-Web:Дополнительный модуль Сервис TourML Приложение B
10. Приложение B. Функции проверки бронирования и бронирования
10.1. Функция CheckBooking
Ниже представлен пример запроса на проверку возможности бронирования.
<?xml version="1.0" ?>
- <bookings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" date="2006-07-11" time="16:18:43.7311809+04:00" uri="http://www.ESystema.ru"> - <booking xmlns="http://tourml.ru/bookings/2004-09-28"> - <header id="10795" checkin="2009-09-04" buyerPerson="1" mainPerson="1" agreementKey="0">
<comment>Данная заявка выполнена для проверки работы сервиса. Саму заявку в работу оправлять не нужно</comment> </header>
- <packets> - <packet id="_1">
<calculated key="3203315" /> </packet> </packets>
- <persons> - <person key="1" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-03-03" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-03-03" /> </passports> </person>
- <person key="2" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-02-02" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-02-02" /> </passports> </person> </persons> </booking> </bookings>
В ответ на проверку бронирования возвращается результат проверки в виде XML-документа. Ниже представлен пример возвращаемого XML-документа.
<?xml version="1.0" ?>
- <agreements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" date="0001-01-01" time="00:00:00.0000000+04:00"> - <agreement xmlns="http://tourml.ru/bookings/2004-09-28"> - <header uri="" checkin="2009-09-04" buyerPerson="1" mainPerson="1" agreementKey="-10" agreementCode="-10" country="Турция" city="АНТАЛИЯ" days="8" quantity="2" price="69939.01" pricePaid="0" currency="рб" creationDate="2009-08-04" payUntil="0001-01-01" status="ok" errorStatus="unknown" commission="699.39">
<comment /> </header>
- <packets> - <packet id="_1"> - <services> - <hotelServices>
<hotelService key="-12" name="HOTEL::АНТАЛИЯ/_NO_CENDER-4*,7 ночей/Double(Standart),Взр./AI Всё включено/" dayBeg="1" nights="7" days="7" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" buildingKey="1037" roomKey="1113" mealKey="38" /> </hotelServices>
- <flightServices> - <flightService key="-10" name="А_П::АНТАЛИЯ/Москва/P76524, AYT-SVO2, 10:15-13:20/Y Экономический класс/" dayBeg="8" nights="0" days="0" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" flightKey="553" tariffKey="89" >
</flightService>
- <flightService key="-11" name="А_П::Москва/АНТАЛИЯ/P76523, SVO2-AYT, 18:40-20:20/Y Экономический класс/" dayBeg="1" nights="0" days="0" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" flightKey="552" tariffKey="89" >
</flightService> </flightServices> <excursionServices />
- <transferServices>
<transferService key="-14" name="Трансфер::АНТАЛИЯ/Аэропорт-Отель (Белек), , /автобус /" dayBeg="1" nights="0" days="0" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" transferKey="383" transportKey="3" /> <transferService key="-15" name="Трансфер::.БЕЛЕК/Отель (Белек) - Аэропорт, , /автобус /" dayBeg="8" nights="0" days="0" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" transferKey="385" transportKey="3" /> </transferServices> <cruiseServices />
- <extraServices>
<extraService key="-13" name="Страховка::Турция/Мед. страховка - 15000$,8 дней/-/" dayBeg="1" nights="7" days="8" men="2" reasonRus="Места есть" reasonLat="Places available" sourceKey="0" classKey="6" subKey="161" subKey1="18" subKey2="0" countryKey="86" cityKey="187" /> </extraServices> </services> </packet> </packets>
- <persons> - <person key="1" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-03-03" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-03-03" /> </passports> </person>
- <person key="2" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-02-02" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-02-02" /> </passports> </person> </persons> <penaltyConditions amount="0.0" currency="" percentage="0" dateLimit="0001-01-01" timeLimit="00:00:00.0000000+04:00" /> </agreement> </agreements>
10.2. Функция CreateBooking
Ниже представлен пример запроса на бронирование.
<?xml version="1.0" ?>
- <bookings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" date="2006-07-11" time="16:18:43.7311809+04:00" uri="http://www.ESystema.ru"> - <booking xmlns="http://tourml.ru/bookings/2004-09-28"> - <header id="10795" checkin="2009-09-04" buyerPerson="1" mainPerson="1" agreementKey="0">
<comment>Данная заявка выполнена для проверки работы сервиса. Саму заявку в работу оправлять не нужно</comment> </header>
- <packets> - <packet id="_1">
<calculated key="3203315" /> </packet> </packets>
- <persons> - <person key="1" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-03-03" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-03-03" /> </passports> </person>
- <person key="2" sourceKey="0" packets="_1" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-02-02" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts>
<phones /> <addresses /> <emails /> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-02-02" /> </passports> </person> </persons> </booking> </bookings>
В ответ на бронирование возвращается результат бронирования – путевка - в виде XML-документа. Ниже представлен пример возвращаемого XML-документа. Все ключи услуг и туристов реальные, полученные из базы данных.
<?xml version="1.0" ?>
- <agreements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" date="0001-01-01" time="00:00:00.0000000+04:00"> - <agreement xmlns="http://tourml.ru/bookings/2004-09-28"> - <header uri="" checkin="2009-09-04" buyerPerson="0" mainPerson="92470" agreementKey="43037" agreementCode="TR 0904001" country="Турция" city="АНТАЛИЯ" days="8" quantity="2" price="69939.01" pricePaid="0" currency="рб" creationDate="2009-08-04" payUntil="2009-08-05" status="ok" errorStatus="unknown" commission="699.39">
<comment /> </header>
- <packets> - <packet id="_1"> - <services> - <hotelServices>
<hotelService key="220699" name="HOTEL::АНТАЛИЯ/_NO_CENDER-4*,7 ночей/Double(Standart),Взр./AI Всё включено/" dayBeg="1" nights="7" days="7" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" buildingKey="1037" roomKey="1113" mealKey="38" /> </hotelServices>
- <flightServices> - <flightService key="220698" name="А_П::Москва/АНТАЛИЯ/P76523, SVO2-AYT, 18:40-20:20/Y Экономический класс/" dayBeg="1" nights="0" days="0" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" flightKey="552" tariffKey="89" >
</flightService>
- <flightService key="220697" name="А_П::АНТАЛИЯ/Москва/P76524, AYT-SVO2, 10:15-13:20/Y Экономический класс/" dayBeg="8" nights="0" days="0" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" flightKey="553" tariffKey="89" >
</flightService> </flightServices> <excursionServices />
- <transferServices>
<transferService key="220702" name="Трансфер::.БЕЛЕК/Отель (Белек) - Аэропорт, , /автобус /" dayBeg="8" nights="0" days="0" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" transferKey="385" transportKey="3" /> <transferService key="220701" name="Трансфер::АНТАЛИЯ/Аэропорт-Отель (Белек), , /автобус /" dayBeg="1" nights="0" days="0" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" transferKey="383" transportKey="3" /> </transferServices> <cruiseServices />
- <extraServices>
<extraService key="220700" name="Страховка::Турция/Мед. страховка - 15000$,8 дней/-/" dayBeg="1" nights="7" days="8" men="2" reasonRus="Ok" reasonLat="Ok" sourceKey="0" classKey="6" subKey="161" subKey1="18" subKey2="0" countryKey="86" cityKey="187" /> </extraServices> </services> </packet> </packets>
- <persons> - <person key="92471" sourceKey="92471" packets="_1" services="" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-02-02" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts> - <phones>
<phone /> </phones>
- <addresses>
<address postalIndex="" city="" street="" building="" flat="" /> </addresses> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-02-02" /> <passport type="national" number="" emittedBy="" emittedWhen="0001-01-01" validTo="0001-01-01" /> </passports> </person>
- <person key="92470" sourceKey="92470" packets="_1" services="" firstNameRus="TEST" lastNameRus="TEST" firstNameLat="TEST" lastNameLat="TEST" sex="male" birthday="1982-03-03" nationalityRus="" nationalityLat="" isTourist="true"> - <contacts> - <phones>
<phone /> </phones>
- <addresses>
<address postalIndex="" city="" street="" building="" flat="" /> </addresses> </contacts>
- <passports>
<passport type="foreign" series="1111" number="111111111" emittedBy="ОВД" emittedWhen="1990-01-01" validTo="2007-03-03" /> <passport type="national" number="" emittedBy="" emittedWhen="0001-01-01" validTo="0001-01-01" /> </passports> </person> </persons> </agreement> </agreements>
10.3. Функция CreateBooking
Ниже представлены экраны программного комлекса Мастер-Тур с результатами бронирования, выполненненого в пункте 10.2 (работа с функцией CreateBooking) на стр. 66
Рис. Путевка в экране работа менеджера
Рис. Информация по путевке
Рис. Информация о туристах
Рис. Детальная информация о туристах