@roomstay/core 0.1.51-0 → 0.1.52-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.js +1 -1
- package/dist/types/Addons/Addon.type.d.ts +24 -0
- package/dist/types/Addons/Addon.types.d.ts +29 -0
- package/dist/types/Analytics/IBigQueryResults.type.d.ts +35 -0
- package/dist/types/Booking/Booking.types.d.ts +7 -0
- package/dist/types/Booking/ConfirmBooking.types.d.ts +19 -0
- package/dist/types/Booking/EBooking.types.d.ts +12 -0
- package/dist/types/Booking/EBookingStatus.type.d.ts +7 -0
- package/dist/types/Booking/GetBooking.types.d.ts +7 -0
- package/dist/types/Booking/IBookingCreateErrorResponse.type.d.ts +11 -0
- package/dist/types/Booking/ICommonQueryParameters.d.ts +3 -0
- package/dist/types/Booking/ICommonQueryParameters.type.d.ts +3 -0
- package/dist/types/Booking/IConfirmBooking.type.d.ts +19 -0
- package/dist/types/Booking/IConfirmBookingRequest.d.ts +14 -0
- package/dist/types/Booking/IConfirmBookingRequest.type.d.ts +14 -0
- package/dist/types/Booking/IGetBooking.type.d.ts +7 -0
- package/dist/types/Booking/IItinerary.type.d.ts +99 -0
- package/dist/types/Booking/IItineraryResponse.d.ts +105 -0
- package/dist/types/Booking/IPackage.type.d.ts +89 -0
- package/dist/types/Booking/IPencilReservation.type.d.ts +16 -0
- package/dist/types/Booking/IPlaceBooking.type.d.ts +83 -0
- package/dist/types/Booking/IRollbackBooking.type.d.ts +6 -0
- package/dist/types/Booking/Itinerary.types.d.ts +108 -0
- package/dist/types/Booking/Package.types.d.ts +89 -0
- package/dist/types/Booking/PencilReservation.types.d.ts +19 -0
- package/dist/types/Booking/PlaceBooking.types.d.ts +83 -0
- package/dist/types/Member/IRoomstayMemberBookingItem.type.d.ts +2 -2
- package/dist/types/Member/IRoomstayMemberJWTData.type.d.ts +3 -0
- package/dist/types/Package/IPackage.type.d.ts +101 -0
- package/dist/types/Package/Package.types.d.ts +101 -0
- package/dist/types/index.d.ts +26 -12
- package/dist/web.js +1 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,a;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>m,AddonPricingType:()=>N,EBookingPaymentMethod:()=>n,ECompanyProvider:()=>c,EDistanceUnitType:()=>g,EFeeType:()=>p,EGuarantyPolicyPrepaymentType:()=>h,EHotelCardProcessor:()=>i,EHotelPriceModel:()=>l,EHotelStateFieldConfiguration:()=>d,EHotelWeekdayStartsOn:()=>u,EIntegration:()=>P,EPlanpayBookingStatus:()=>a,ERMSDiscountType:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>R,HttpMethod:()=>T,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>o,IMaintenanceStatusService:()=>_,PCIBookingCardProcessorTypes:()=>r,RoundingType:()=>C,TotalCalculator:()=>Q,calculateFeeAmount:()=>I,calculateTotalForMemberBooking:()=>O,getFeeOptionValidity:()=>v,getFilteredBookingAddonFees:()=>k,getFilteredBookingFees:()=>U,getFilteredBookingRateFees:()=>B,nameof:()=>G,resizeRoomstayImageUrl:()=>M,roundMoney:()=>F,subset:()=>b,uppercaseString:()=>x}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave"}(i||(i={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={}));const r=[];let o,c,l,d,u,P,s,g,y,R,_,h,E,T,p,N;!function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(o||(o={})),function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(l||(l={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(d||(d={})),function(e){e.Monday="monday",e.Sunday="sunday"}(u||(u={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(P||(P={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(g||(g={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(y||(y={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(R||(R={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(_||(_={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(h||(h={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(T||(T={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(p||(p={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(N||(N={}));const m=[N.PER_NIGHT,N.PER_PERSON_PER_NIGHT,N.PER_QUANTITY_NAME_PER_NIGHT,N.PER_ROOM_QUANTITY_PER_NIGHT,N.PER_PERSON_OCCUPANCY_PER_NIGHT,N.PER_ADULT_OCCUPANCY_PER_NIGHT,N.PER_CHILD_OCCUPANCY_PER_NIGHT,N.PER_ALL_PERSONS_PER_NIGHT],O=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},f=require("decimal.js");var A=e.n(f);const C={UP:A().ROUND_UP,DOWN:A().ROUND_DOWN,CEIL:A().ROUND_CEIL,FLOOR:A().ROUND_FLOOR,HALF_UP:A().ROUND_HALF_UP,HALF_DOWN:A().ROUND_HALF_DOWN,HALF_EVEN:A().ROUND_HALF_EVEN,HALF_CEIL:A().ROUND_HALF_CEIL,HALF_FLOOR:A().ROUND_HALF_FLOOR},F=(e,t)=>{const{precision:n=2,rounding:i=C.HALF_UP}=t||{};return new(A())(e).toDecimalPlaces(n,i).toNumber()};function I(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:a=!1,extractedFromRates:r=!1,removedPercentages:o=[]}=t,c=F(n);switch(e.feeType){case p.PercentageOfBooking:if(a)return F(c*e.amount/(100+e.amount));if(r){const t=o.reduce(((e,t)=>e+t/(100+t)),0);return F(c/(1-t)*e.amount/(100+e.amount))}return F(c*(e.amount/100));case p.FixedChargePerRoom:case p.FixedChargePerBooking:return e.amount;case p.NightlyChargePerRoom:return F(e.amount*i);default:return 0}}const S=[p.FixedChargePerBooking],H=[p.PercentageOfBooking,p.FixedChargePerRoom,p.NightlyChargePerRoom],L=[p.PercentageOfBooking];function D(e,t){return e.filter((e=>t.includes(e.feeType)))}function U(e){return D(e,S)}function B(e){return D(e,H)}function k(e){return D(e,L)}function v(e){return{includeInRates:[p.PercentageOfBooking,p.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===p.PercentageOfBooking,appliesToAddons:e===p.PercentageOfBooking,includePreviousFeesInCalculation:e===p.PercentageOfBooking}}const G=e=>e,b=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},M=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Q{}function x(e){return e.toUpperCase()}Q.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,a=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===N.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===N.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(a=e.childQuantity*Number(e.childPrice));let r=n+i+a;return m.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:a,addonTotal:r}},Q.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Q.calculateBaseAddonTotal(n,t);let a=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{a+=n.quantity*e.amount})):a=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{a+=n.adultQuantity*e.amount})):a+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{a+=n.childQuantity??1*e.amount})):a+=n.childQuantity*Number(n.childFee))),m.includes(n.pricingType)&&n.nights&&!t&&(a*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+a,total:e.total+i.addonTotal+a}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Q.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Q.calculateBaseAddonTotal(n,t);let a=n.fees||0;n.itemisedFees?.length&&(a=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+a;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+a,total:e.total+i.addonTotal+a,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Q.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(e.addons?.length){const a=(e.addons??[]).map((e=>({...e,nights:i})));n+=Q.calculateReservationAddonTotal(a,t)?.total}})),F(n)},module.exports=t})();
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let i,o,n,r,a,d;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>I,AddonPricingType:()=>f,EAddonPricingType:()=>i,EBookingFlow:()=>n,EBookingPaymentMethod:()=>r,EBookingStatus:()=>o,ECompanyProvider:()=>u,EDistanceUnitType:()=>E,EFeeType:()=>C,EGuarantyPolicyPrepaymentType:()=>T,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>h,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>y,EIntegration:()=>R,EPlanpayBookingStatus:()=>d,ERMSDiscountType:()=>N,ERoomstayEventSource:()=>v,ERoomstayImageSize:()=>p,GuestProfile:()=>P,HttpMethod:()=>O,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>m,ItineraryResponse:()=>s,PCIBookingCardProcessorTypes:()=>c,Package:()=>A,Reservation:()=>l,ReservedPackage:()=>F,RoundingType:()=>L,TotalCalculator:()=>V,calculateFeeAmount:()=>k,calculateTotalForMemberBooking:()=>S,getFeeOptionValidity:()=>w,getFilteredBookingAddonFees:()=>Y,getFilteredBookingFees:()=>M,getFilteredBookingRateFees:()=>x,nameof:()=>j,resizeRoomstayImageUrl:()=>W,roundMoney:()=>U,subset:()=>q,uppercaseString:()=>z}),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(i||(i={})),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(o||(o={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(d||(d={}));const c=[];class s{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class l{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new P,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class P{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let u,h,g,y,R,_,E,N,p,m,T,v,O,C,f;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(u||(u={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(h||(h={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(y||(y={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(R||(R={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(E||(E={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(N||(N={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(p||(p={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(m||(m={}));class A{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class F extends A{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(T||(T={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(v||(v={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(O||(O={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(C||(C={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(f||(f={}));const I=[f.PER_NIGHT,f.PER_PERSON_PER_NIGHT,f.PER_QUANTITY_NAME_PER_NIGHT,f.PER_ROOM_QUANTITY_PER_NIGHT,f.PER_PERSON_OCCUPANCY_PER_NIGHT,f.PER_ADULT_OCCUPANCY_PER_NIGHT,f.PER_CHILD_OCCUPANCY_PER_NIGHT,f.PER_ALL_PERSONS_PER_NIGHT],S=e=>{let t=0;const i=Object.values(e.itinerary);for(const e of i){const i=Object.keys(e.nights);for(const o of i)t+=e.nights[o].total}return t},H=require("decimal.js");var D=e.n(H);const L={UP:D().ROUND_UP,DOWN:D().ROUND_DOWN,CEIL:D().ROUND_CEIL,FLOOR:D().ROUND_FLOOR,HALF_UP:D().ROUND_HALF_UP,HALF_DOWN:D().ROUND_HALF_DOWN,HALF_EVEN:D().ROUND_HALF_EVEN,HALF_CEIL:D().ROUND_HALF_CEIL,HALF_FLOOR:D().ROUND_HALF_FLOOR},U=(e,t)=>{const{precision:i=2,rounding:o=L.HALF_UP}=t||{};return new(D())(e).toDecimalPlaces(i,o).toNumber()};function k(e,t={}){const{baseAmount:i=0,numberOfNights:o=1,feeIncludedInBaseAmount:n=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,d=U(i);switch(e.feeType){case C.PercentageOfBooking:if(n)return U(d*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return U(d/(1-t)*e.amount/(100+e.amount))}return U(d*(e.amount/100));case C.FixedChargePerRoom:case C.FixedChargePerBooking:return e.amount;case C.NightlyChargePerRoom:return U(e.amount*o);default:return 0}}const G=[C.FixedChargePerBooking],B=[C.PercentageOfBooking,C.FixedChargePerRoom,C.NightlyChargePerRoom],b=[C.PercentageOfBooking];function Q(e,t){return e.filter((e=>t.includes(e.feeType)))}function M(e){return Q(e,G)}function x(e){return Q(e,B)}function Y(e){return Q(e,b)}function w(e){return{includeInRates:[C.PercentageOfBooking,C.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===C.PercentageOfBooking,appliesToAddons:e===C.PercentageOfBooking,includePreviousFeesInCalculation:e===C.PercentageOfBooking}}const j=e=>e,q=(e,t)=>{const i={};return t.forEach((t=>{t in e&&(i[t]=e[t])})),i},W=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class V{}function z(e){return e.toUpperCase()}V.calculateBaseAddonTotal=(e,t)=>{let i=0,o=0,n=0;e.price&&e.quantity&&(i=e.quantity*Number(e.price)),e.pricingType===f.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?i*=e.adultQuantity:e.pricingType===f.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(i*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(o=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(n=e.childQuantity*Number(e.childPrice));let r=i+o+n;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:i,indAdultPrice:o,indChildPrice:n,addonTotal:r}},V.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=0;return(i.fee||i.fees?.length)&&i.quantity?i.fees?.length?i.fees.forEach((e=>{n+=i.quantity*e.amount})):n=i.quantity*Number(i.fee):((i.adultFee||i.adultFees?.length)&&i.adultQuantity&&(i.adultFees?.length?i.adultFees.forEach((e=>{n+=i.adultQuantity*e.amount})):n+=i.adultQuantity??1*Number(i.adultFee)),(i.childFee||i.childFees?.length)&&i.childQuantity&&(i.childFees?.length?i.childFees.forEach((e=>{n+=i.childQuantity??1*e.amount})):n+=i.childQuantity*Number(i.childFee))),I.includes(i.pricingType)&&i.nights&&!t&&(n*=i.nights),{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),V.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=i.fees||0;i.itemisedFees?.length&&(n=i.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=i.itemisedFees?.length?o.addonTotal:o.addonTotal+n;return{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),V.calculateTotalForReservation=(e,t=!1)=>{let i=0;return e.itemisedFees?.forEach((e=>{i+=e.amount})),e.reservations.forEach((e=>{i+=e.total.afterTax;const o=Object.keys(e.nights)?.length??0;if(e.addons?.length){const n=(e.addons??[]).map((e=>({...e,nights:o})));i+=V.calculateReservationAddonTotal(n,t)?.total}})),U(i)},module.exports=t})();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum EAddonPricingType {
|
|
2
|
+
PER_STAY = "Per stay",
|
|
3
|
+
PER_NIGHT = "Per night",
|
|
4
|
+
PER_PERSON = "Per person",
|
|
5
|
+
PER_PERSON_PER_NIGHT = "Per person per night",
|
|
6
|
+
PER_ALL_PERSONS = "Per all persons",
|
|
7
|
+
PER_ALL_PERSONS_PER_NIGHT = "Per all persons per night"
|
|
8
|
+
}
|
|
9
|
+
export type IAddonPriceDetails = {
|
|
10
|
+
adultPrice: number;
|
|
11
|
+
childPrice: number;
|
|
12
|
+
price: number;
|
|
13
|
+
adultFee: number;
|
|
14
|
+
childFee: number;
|
|
15
|
+
fee: number;
|
|
16
|
+
adultFees?: IAddonPriceDetailsFee[];
|
|
17
|
+
childFees?: IAddonPriceDetailsFee[];
|
|
18
|
+
fees?: IAddonPriceDetailsFee[];
|
|
19
|
+
pricingType: EAddonPricingType;
|
|
20
|
+
};
|
|
21
|
+
export type IAddonPriceDetailsFee = {
|
|
22
|
+
name: string;
|
|
23
|
+
amount: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum EAddonPricingType {
|
|
2
|
+
PER_STAY = "Per stay",
|
|
3
|
+
PER_NIGHT = "Per night",
|
|
4
|
+
PER_PERSON = "Per person",
|
|
5
|
+
PER_PERSON_PER_NIGHT = "Per person per night",
|
|
6
|
+
PER_ALL_PERSONS = "Per all persons",
|
|
7
|
+
PER_ALL_PERSONS_PER_NIGHT = "Per all persons per night",
|
|
8
|
+
PER_QUANTITY_NAME_PER_NIGHT = "Per Quantity Name Per Night",
|
|
9
|
+
PER_ROOM_QUANTITY_PER_NIGHT = "Per Room Quantity Per Night",
|
|
10
|
+
PER_PERSON_OCCUPANCY_PER_NIGHT = "Per Person Occupancy Per Night",
|
|
11
|
+
PER_ADULT_OCCUPANCY_PER_NIGHT = "Per Adult Occupancy Per Night",
|
|
12
|
+
PER_CHILD_OCCUPANCY_PER_NIGHT = "Per Child Occupancy Per Night"
|
|
13
|
+
}
|
|
14
|
+
export type IAddonPriceDetails = {
|
|
15
|
+
adultPrice: number;
|
|
16
|
+
childPrice: number;
|
|
17
|
+
price: number;
|
|
18
|
+
adultFee: number;
|
|
19
|
+
childFee: number;
|
|
20
|
+
fee: number;
|
|
21
|
+
adultFees?: IAddonPriceDetailsFee[];
|
|
22
|
+
childFees?: IAddonPriceDetailsFee[];
|
|
23
|
+
fees?: IAddonPriceDetailsFee[];
|
|
24
|
+
pricingType: EAddonPricingType;
|
|
25
|
+
};
|
|
26
|
+
export type IAddonPriceDetailsFee = {
|
|
27
|
+
name: string;
|
|
28
|
+
amount: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type IDailyMetrics = {
|
|
2
|
+
date: string;
|
|
3
|
+
revenue: number;
|
|
4
|
+
purchases: number;
|
|
5
|
+
sessionCount: number;
|
|
6
|
+
};
|
|
7
|
+
export type IDailyRoomBreakdown = {
|
|
8
|
+
date: string;
|
|
9
|
+
roomName: string;
|
|
10
|
+
purchases: number;
|
|
11
|
+
};
|
|
12
|
+
export type IRegionBreakdown = {
|
|
13
|
+
country: string;
|
|
14
|
+
region: string;
|
|
15
|
+
purchases: number;
|
|
16
|
+
revenue: number;
|
|
17
|
+
};
|
|
18
|
+
export type ICheckoutFunnel = {
|
|
19
|
+
roomName: string;
|
|
20
|
+
selectedDate: number;
|
|
21
|
+
addedToCart: number;
|
|
22
|
+
startedCheckout: number;
|
|
23
|
+
completedCheckout: number;
|
|
24
|
+
};
|
|
25
|
+
export type IBigQueryResults = {
|
|
26
|
+
purchases: number;
|
|
27
|
+
cancellations: number;
|
|
28
|
+
revenue: number;
|
|
29
|
+
conversionRate: number;
|
|
30
|
+
totalDateSelections: number;
|
|
31
|
+
dailyMetrics: IDailyMetrics[];
|
|
32
|
+
dailyRoomsBreakdown: IDailyRoomBreakdown[];
|
|
33
|
+
regionBreakdown: IRegionBreakdown[];
|
|
34
|
+
checkoutFunnel: ICheckoutFunnel[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRoomstayMemberJWTData } from '../Member/IRoomstayMemberJWTData.type';
|
|
2
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters.type';
|
|
3
|
+
import { ItineraryResponse } from './Itinerary.types';
|
|
4
|
+
export type IConfirmBookingRequest = {
|
|
5
|
+
reservationIds: string[];
|
|
6
|
+
itineraryId: string;
|
|
7
|
+
planpayCheckoutId?: string;
|
|
8
|
+
paymentId?: string;
|
|
9
|
+
roomstayId?: string;
|
|
10
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
11
|
+
source?: 'External' | 'Frontend' | 'Admin';
|
|
12
|
+
isBlocking?: boolean;
|
|
13
|
+
} & ICommonQueryParameters;
|
|
14
|
+
export type IConfirmBookingResponse = ItineraryResponse;
|
|
15
|
+
export type ICancelBookingRequest = {
|
|
16
|
+
email?: string;
|
|
17
|
+
reservationId: string;
|
|
18
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
19
|
+
} & ICommonQueryParameters;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum EBookingStatus {
|
|
2
|
+
Pending = "Pending",
|
|
3
|
+
Processing = "Processing",
|
|
4
|
+
Committed = "Committed",
|
|
5
|
+
Cancelled = "Cancelled",
|
|
6
|
+
Reverted = "Reverted"
|
|
7
|
+
}
|
|
8
|
+
export declare enum EBookingFlow {
|
|
9
|
+
Default = "Default",
|
|
10
|
+
PreCheckoutPencil = "PreCheckoutPencil",
|
|
11
|
+
PostCheckoutPencil = "PostCheckoutPencil"
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters.type';
|
|
2
|
+
import { ItineraryResponse } from './Itinerary.types';
|
|
3
|
+
export type IGetBookingRequest = {
|
|
4
|
+
email?: string;
|
|
5
|
+
reservationId: string;
|
|
6
|
+
} & ICommonQueryParameters;
|
|
7
|
+
export type IGetBookingResponse = ItineraryResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the response body that comes down if a booking fails anywhere in the booking flow.
|
|
3
|
+
*
|
|
4
|
+
* Object will contain a public message only, with partial reservation data to be able to attempt to "resume" the booking
|
|
5
|
+
*/
|
|
6
|
+
export type IBookingCreateErrorResponse = {
|
|
7
|
+
canRetryPayment: boolean;
|
|
8
|
+
isPaymentTaken: boolean;
|
|
9
|
+
publicMessage: string;
|
|
10
|
+
roomstayId: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRoomstayMemberJWTData } from '../Member/IRoomstayMemberJWTData.type';
|
|
2
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters.type';
|
|
3
|
+
import { ItineraryResponse } from './Itinerary.types';
|
|
4
|
+
export type IConfirmBookingRequest = {
|
|
5
|
+
reservationIds: string[];
|
|
6
|
+
itineraryId: string;
|
|
7
|
+
planpayCheckoutId?: string;
|
|
8
|
+
paymentId?: string;
|
|
9
|
+
roomstayId?: string;
|
|
10
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
11
|
+
source?: 'External' | 'Frontend' | 'Admin';
|
|
12
|
+
isBlocking?: boolean;
|
|
13
|
+
} & ICommonQueryParameters;
|
|
14
|
+
export type IConfirmBookingResponse = ItineraryResponse;
|
|
15
|
+
export type ICancelBookingRequest = {
|
|
16
|
+
email?: string;
|
|
17
|
+
reservationId: string;
|
|
18
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
19
|
+
} & ICommonQueryParameters;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRoomstayMemberJWTData } from 'types/Member/IRoomstayMemberJWTData.type';
|
|
2
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters';
|
|
3
|
+
import { IItineraryResponse } from './IItineraryResponse';
|
|
4
|
+
export type IConfirmBookingRequest = {
|
|
5
|
+
reservationIds: string[];
|
|
6
|
+
itineraryId: string;
|
|
7
|
+
planpayCheckoutId?: string;
|
|
8
|
+
paymentId?: string;
|
|
9
|
+
roomstayId?: string;
|
|
10
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
11
|
+
source?: 'External' | 'Frontend' | 'Admin';
|
|
12
|
+
isBlocking?: boolean;
|
|
13
|
+
} & ICommonQueryParameters;
|
|
14
|
+
export type IConfirmBookingResponse = IItineraryResponse;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRoomstayMemberJWTData } from 'types/Member/IRoomstayMemberJWTData.type';
|
|
2
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters.type';
|
|
3
|
+
import { IItineraryResponse } from './IItinerary.type';
|
|
4
|
+
export type IConfirmBookingRequest = {
|
|
5
|
+
reservationIds: string[];
|
|
6
|
+
itineraryId: string;
|
|
7
|
+
planpayCheckoutId?: string;
|
|
8
|
+
paymentId?: string;
|
|
9
|
+
roomstayId?: string;
|
|
10
|
+
frontendMember?: IRoomstayMemberJWTData;
|
|
11
|
+
source?: 'External' | 'Frontend' | 'Admin';
|
|
12
|
+
isBlocking?: boolean;
|
|
13
|
+
} & ICommonQueryParameters;
|
|
14
|
+
export type IConfirmBookingResponse = IItineraryResponse;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICommonQueryParameters } from './ICommonQueryParameters.type';
|
|
2
|
+
import { ItineraryResponse } from './Itinerary.types';
|
|
3
|
+
export type IGetBookingRequest = {
|
|
4
|
+
email?: string;
|
|
5
|
+
reservationId: string;
|
|
6
|
+
} & ICommonQueryParameters;
|
|
7
|
+
export type IGetBookingResponse = ItineraryResponse;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { EBookingPaymentMethod } from './IBookingPayment.type';
|
|
2
|
+
import { IPrice } from './IPrice.type';
|
|
3
|
+
import { IReservedPackage } from '../Package/IPackage.type';
|
|
4
|
+
export type IItineraryResponse = {
|
|
5
|
+
roomstayId: string;
|
|
6
|
+
itineraryNumber?: string;
|
|
7
|
+
total?: IAmount;
|
|
8
|
+
hotelFrontendId?: string;
|
|
9
|
+
reservations: IReservation[];
|
|
10
|
+
payment?: {
|
|
11
|
+
planpay?: {
|
|
12
|
+
id: string;
|
|
13
|
+
checkoutWorkflow: ICheckoutWorkflowType;
|
|
14
|
+
};
|
|
15
|
+
external?: {
|
|
16
|
+
id: string;
|
|
17
|
+
redirectUrl: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
feesSummary?: IItemisedBookingFeeResponse[];
|
|
21
|
+
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
22
|
+
warnings?: string[];
|
|
23
|
+
};
|
|
24
|
+
export type IReservation = {
|
|
25
|
+
reservationNumber: string;
|
|
26
|
+
roomType: string;
|
|
27
|
+
roomCode: string;
|
|
28
|
+
rate: string;
|
|
29
|
+
rateCode?: string;
|
|
30
|
+
images: string[];
|
|
31
|
+
guaranteePolicy?: string;
|
|
32
|
+
cancellationPolicy?: string;
|
|
33
|
+
checkInDate: string;
|
|
34
|
+
checkOutDate: string;
|
|
35
|
+
nights: {
|
|
36
|
+
[date: string]: IPrice;
|
|
37
|
+
};
|
|
38
|
+
guestCounts: IGuestCounts;
|
|
39
|
+
guest: IGuestProfile;
|
|
40
|
+
paymentCard: {
|
|
41
|
+
type: string | undefined;
|
|
42
|
+
last4: string;
|
|
43
|
+
expiry: string;
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
paymentMethod: EBookingPaymentMethod;
|
|
47
|
+
total: IAmount;
|
|
48
|
+
status: string;
|
|
49
|
+
isCancelable: boolean;
|
|
50
|
+
addons: IReservedPackage[] | undefined;
|
|
51
|
+
comments?: string[];
|
|
52
|
+
specialRequests?: string[];
|
|
53
|
+
promoCode?: string;
|
|
54
|
+
guaranteePolicyLongDescription?: string;
|
|
55
|
+
cancellationPolicyLongDescription?: string;
|
|
56
|
+
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
57
|
+
};
|
|
58
|
+
export type IGuestProfile = {
|
|
59
|
+
title?: string;
|
|
60
|
+
firstName?: string;
|
|
61
|
+
middleName?: string;
|
|
62
|
+
lastName?: string;
|
|
63
|
+
nameSuffix?: string;
|
|
64
|
+
phone?: string;
|
|
65
|
+
email?: string;
|
|
66
|
+
address: IAddress;
|
|
67
|
+
marketingOptIn?: boolean;
|
|
68
|
+
country: string;
|
|
69
|
+
};
|
|
70
|
+
export type IGuestCounts = {
|
|
71
|
+
adults: number;
|
|
72
|
+
children: number;
|
|
73
|
+
};
|
|
74
|
+
export type IAddress = {
|
|
75
|
+
line1?: string;
|
|
76
|
+
line2?: string;
|
|
77
|
+
line3?: string;
|
|
78
|
+
city?: string;
|
|
79
|
+
postalCode?: string;
|
|
80
|
+
state?: string;
|
|
81
|
+
country?: string;
|
|
82
|
+
};
|
|
83
|
+
export type IAmount = {
|
|
84
|
+
beforeTax: number;
|
|
85
|
+
afterTax: number;
|
|
86
|
+
beforeFees?: number;
|
|
87
|
+
};
|
|
88
|
+
export type ICheckoutWorkflowType = {
|
|
89
|
+
sdkWidget: {
|
|
90
|
+
type: string;
|
|
91
|
+
id: string;
|
|
92
|
+
scriptUrl: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export type IItemisedBookingFeeResponse = {
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
amount: number;
|
|
99
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { EBookingPaymentMethod } from './IBookingPayment.type';
|
|
2
|
+
import { IReservedPackage } from './Package.types';
|
|
3
|
+
export type IItineraryResponse = {
|
|
4
|
+
roomstayId: string;
|
|
5
|
+
itineraryNumber?: string;
|
|
6
|
+
total?: IAmount;
|
|
7
|
+
hotelFrontendId?: string;
|
|
8
|
+
reservations: IReservation[];
|
|
9
|
+
payment?: {
|
|
10
|
+
planpay?: {
|
|
11
|
+
id: string;
|
|
12
|
+
checkoutWorkflow: ICheckoutWorkflowType;
|
|
13
|
+
};
|
|
14
|
+
external?: {
|
|
15
|
+
id: string;
|
|
16
|
+
redirectUrl: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
feesSummary?: IItemisedBookingFeeResponse[];
|
|
20
|
+
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
21
|
+
warnings?: string[];
|
|
22
|
+
};
|
|
23
|
+
export type IReservation = {
|
|
24
|
+
reservationNumber: string;
|
|
25
|
+
roomType: string;
|
|
26
|
+
roomCode: string;
|
|
27
|
+
rate: string;
|
|
28
|
+
rateCode?: string;
|
|
29
|
+
images: string[];
|
|
30
|
+
guaranteePolicy?: string;
|
|
31
|
+
cancellationPolicy?: string;
|
|
32
|
+
checkInDate: string;
|
|
33
|
+
checkOutDate: string;
|
|
34
|
+
nights: {
|
|
35
|
+
[date: string]: IPrice;
|
|
36
|
+
};
|
|
37
|
+
guestCounts: IGuestCounts;
|
|
38
|
+
guest: IGuestProfile;
|
|
39
|
+
paymentCard: {
|
|
40
|
+
type: string | undefined;
|
|
41
|
+
last4: string;
|
|
42
|
+
expiry: string;
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
paymentMethod: EBookingPaymentMethod;
|
|
46
|
+
total: IAmount;
|
|
47
|
+
status: string;
|
|
48
|
+
isCancelable: boolean;
|
|
49
|
+
addons: IReservedPackage[] | undefined;
|
|
50
|
+
comments?: string[];
|
|
51
|
+
specialRequests?: string[];
|
|
52
|
+
promoCode?: string;
|
|
53
|
+
guaranteePolicyLongDescription?: string;
|
|
54
|
+
cancellationPolicyLongDescription?: string;
|
|
55
|
+
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
56
|
+
};
|
|
57
|
+
export type IGuestProfile = {
|
|
58
|
+
title?: string;
|
|
59
|
+
firstName?: string;
|
|
60
|
+
middleName?: string;
|
|
61
|
+
lastName?: string;
|
|
62
|
+
nameSuffix?: string;
|
|
63
|
+
phone?: string;
|
|
64
|
+
email?: string;
|
|
65
|
+
address: IAddress;
|
|
66
|
+
marketingOptIn?: boolean;
|
|
67
|
+
country: string;
|
|
68
|
+
};
|
|
69
|
+
export type IGuestCounts = {
|
|
70
|
+
adults: number;
|
|
71
|
+
children: number;
|
|
72
|
+
};
|
|
73
|
+
export type IAddress = {
|
|
74
|
+
line1?: string;
|
|
75
|
+
line2?: string;
|
|
76
|
+
line3?: string;
|
|
77
|
+
city?: string;
|
|
78
|
+
postalCode?: string;
|
|
79
|
+
state?: string;
|
|
80
|
+
country?: string;
|
|
81
|
+
};
|
|
82
|
+
export type IAmount = {
|
|
83
|
+
beforeTax: number;
|
|
84
|
+
afterTax: number;
|
|
85
|
+
beforeFees?: number;
|
|
86
|
+
};
|
|
87
|
+
export type IPrice = {
|
|
88
|
+
cost: number;
|
|
89
|
+
discount: number;
|
|
90
|
+
tax: number;
|
|
91
|
+
fee: number;
|
|
92
|
+
total: number;
|
|
93
|
+
};
|
|
94
|
+
export type ICheckoutWorkflowType = {
|
|
95
|
+
sdkWidget: {
|
|
96
|
+
type: string;
|
|
97
|
+
id: string;
|
|
98
|
+
scriptUrl: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export type IItemisedBookingFeeResponse = {
|
|
102
|
+
name: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
amount: number;
|
|
105
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { IAddonPriceDetailsFee } from 'types/Addons/Addon.type';
|
|
2
|
+
import { IItemisedBookingFeeResponse } from './IItinerary.type';
|
|
3
|
+
export type IPackage = {
|
|
4
|
+
/**
|
|
5
|
+
* The SynXis CR RatePlan Code associated with the Package if the Package is restricted to certain RatePlans
|
|
6
|
+
*/
|
|
7
|
+
ratePlanCode?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the price for this package is included in the room rate.
|
|
12
|
+
* (Always `false` unless the price is zero)
|
|
13
|
+
*/
|
|
14
|
+
inclusive: boolean;
|
|
15
|
+
image: string[];
|
|
16
|
+
url?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Defines how a service is priced.
|
|
19
|
+
* Values:
|
|
20
|
+
* Per Stay
|
|
21
|
+
* Per Night
|
|
22
|
+
* Per Person
|
|
23
|
+
* Per Person Per Night
|
|
24
|
+
*/
|
|
25
|
+
pricingType: string;
|
|
26
|
+
/**
|
|
27
|
+
* Number of available items for sale.
|
|
28
|
+
*/
|
|
29
|
+
quantity?: number;
|
|
30
|
+
category: string;
|
|
31
|
+
cancelPenalty?: string | null;
|
|
32
|
+
guaranteeDescription?: string | null;
|
|
33
|
+
availability: {
|
|
34
|
+
[date: string]: IPriceInfo;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type IReservedPackage = IPackage & {
|
|
38
|
+
code?: string | undefined;
|
|
39
|
+
price?: number;
|
|
40
|
+
fees?: number;
|
|
41
|
+
itemisedFees?: IItemisedBookingFeeResponse[];
|
|
42
|
+
adultQuantity?: number;
|
|
43
|
+
childQuantity?: number;
|
|
44
|
+
adultPrice?: number;
|
|
45
|
+
childPrice?: number;
|
|
46
|
+
startDate?: string;
|
|
47
|
+
startTime?: string;
|
|
48
|
+
hideDatePicker?: boolean;
|
|
49
|
+
order?: number;
|
|
50
|
+
};
|
|
51
|
+
export type IPriceInfo = {
|
|
52
|
+
/**
|
|
53
|
+
* Number of available items for sale.
|
|
54
|
+
*/
|
|
55
|
+
quantity: number;
|
|
56
|
+
/**
|
|
57
|
+
* Price per quantity
|
|
58
|
+
*/
|
|
59
|
+
price?: number;
|
|
60
|
+
adultPrice?: number;
|
|
61
|
+
childPrice?: number;
|
|
62
|
+
fees?: IAddonPriceDetailsFee[];
|
|
63
|
+
adultFees?: IAddonPriceDetailsFee[];
|
|
64
|
+
childFees?: IAddonPriceDetailsFee[];
|
|
65
|
+
timeSlots?: ITimeSlot[];
|
|
66
|
+
};
|
|
67
|
+
export type ITimeSlot = {
|
|
68
|
+
/**
|
|
69
|
+
The start date and time when the package is available.
|
|
70
|
+
If the package applies during the whole stay, this node is not returned unless the time needs to be selected. In that case, the Start and End dates do not
|
|
71
|
+
include the date: @Start="T07:30:00" and @End="T17:30:00" and @Increment="00:60:00"
|
|
72
|
+
Type: DateTime
|
|
73
|
+
**/
|
|
74
|
+
startTime?: string;
|
|
75
|
+
/**
|
|
76
|
+
The end date / time when the package is available.
|
|
77
|
+
If the package component applies during the whole stay, this node is not returned unless the time needs to be selected. In that case, the Start and End dates
|
|
78
|
+
do not include the date: @Start="T07:30:00" and @End="T17:30:00" and @Increment="00:60:00"
|
|
79
|
+
Type: DateTime
|
|
80
|
+
*/
|
|
81
|
+
endTime?: string;
|
|
82
|
+
/**
|
|
83
|
+
Used with @Start and @End. Indicates the interval when the package or service is available.
|
|
84
|
+
For example, a package with golf lessons from 7:30 am to 5:30 pm with instructions and available hourly has the TimeSpan attributes set as: @Start="2015-
|
|
85
|
+
010-28T07:30:00" and @End="2015-10-28T17:30:00" and @Increment="00:60:00"
|
|
86
|
+
Type: Time
|
|
87
|
+
*/
|
|
88
|
+
increment?: string;
|
|
89
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBookingQuoteRequest, IBookingQuoteResponse } from './IBookingQuote.type';
|
|
2
|
+
export type IPencilReservationRequest = IBookingQuoteRequest & {
|
|
3
|
+
pencilId?: string;
|
|
4
|
+
rows: {
|
|
5
|
+
pencilId: string;
|
|
6
|
+
} & IBookingQuoteRequest['rows'][number][];
|
|
7
|
+
};
|
|
8
|
+
export type IPencilReservationResponse = {
|
|
9
|
+
timeout?: Date;
|
|
10
|
+
pencilId?: string;
|
|
11
|
+
rows: {
|
|
12
|
+
rowId: string;
|
|
13
|
+
pencilId: string;
|
|
14
|
+
}[];
|
|
15
|
+
quote?: IBookingQuoteResponse;
|
|
16
|
+
};
|