fix: publicpromotion needs to be handled differently since api use the same label for different thing
This commit is contained in:
committed by
Michael Zetterberg
parent
775c986f35
commit
81f579bbfe
@@ -289,12 +289,34 @@ export default function PaymentClient({
|
||||
payment,
|
||||
rooms: rooms.map(({ room }, idx) => {
|
||||
let bookingCode = undefined
|
||||
if (
|
||||
room.roomRate.rateDefinition &&
|
||||
room.roomRate.rateDefinition.rateType !== RateTypeEnum.Regular
|
||||
) {
|
||||
bookingCode = room.roomRate.rateDefinition.rateCode
|
||||
if (room.roomRate.rateDefinition) {
|
||||
switch (room.roomRate.rateDefinition.rateType) {
|
||||
case RateTypeEnum.Regular:
|
||||
// do nothing, regular is not bookable with bookingCode
|
||||
break
|
||||
case RateTypeEnum.PublicPromotion:
|
||||
// PublicPromotion WITH CODE
|
||||
// only way to figure it out since API use the same
|
||||
// label for both yet only one should have bookingCoke
|
||||
if (
|
||||
booking.bookingCode === room.roomRate.rateDefinition.rateCode
|
||||
) {
|
||||
bookingCode = booking.bookingCode
|
||||
}
|
||||
break
|
||||
case RateTypeEnum.Arb:
|
||||
case RateTypeEnum.Company:
|
||||
case RateTypeEnum.CorporateCheque:
|
||||
case RateTypeEnum.Promotion:
|
||||
case RateTypeEnum.Redemption:
|
||||
case RateTypeEnum.TravelAgent:
|
||||
case RateTypeEnum.Voucher:
|
||||
default:
|
||||
bookingCode = booking.bookingCode
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
adults: room.adults,
|
||||
bookingCode,
|
||||
|
||||
Reference in New Issue
Block a user