Merged in feat/SW-3526-show-sas-eb-points-rate-in- (pull request #2933)
feat(SW-3526): Show EB points rate and label in booking flow * feat(SW-3526): Show EB points rate and label in booking flow * feat(SW-3526) Optimized points currency code * feat(SW-3526) Removed extra multiplication for token expiry after rebase * feat(SW-3526): Updated to exhaustive check and thow if type error Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -17,10 +17,12 @@ export function getTotalPrice({
|
||||
selectedRates,
|
||||
isMember,
|
||||
addAdditionalCost = true,
|
||||
pointsCurrency,
|
||||
}: {
|
||||
selectedRates: Array<SelectedRate | null>
|
||||
isMember: boolean
|
||||
addAdditionalCost?: boolean
|
||||
pointsCurrency?: CurrencyEnum
|
||||
}): Price | null {
|
||||
const mainRoom = selectedRates[0]
|
||||
const mainRoomRate = mainRoom?.rate
|
||||
@@ -45,7 +47,8 @@ export function getTotalPrice({
|
||||
mainRoom.roomConfiguration?.selectedPackages.filter(
|
||||
(pkg) => "localPrice" in pkg
|
||||
) ?? null,
|
||||
addAdditionalCost
|
||||
addAdditionalCost,
|
||||
pointsCurrency
|
||||
)
|
||||
}
|
||||
if ("voucher" in mainRoomRate) {
|
||||
@@ -156,7 +159,8 @@ function calculateTotalPrice(
|
||||
function calculateRedemptionTotalPrice(
|
||||
redemption: RedemptionProduct["redemption"],
|
||||
packages: RoomPackage[] | null,
|
||||
addAdditonalCost: boolean
|
||||
addAdditonalCost: boolean,
|
||||
pointsCurrency?: CurrencyEnum
|
||||
) {
|
||||
const pkgsSum = addAdditonalCost
|
||||
? sumPackages(packages)
|
||||
@@ -179,7 +183,7 @@ function calculateRedemptionTotalPrice(
|
||||
local: {
|
||||
additionalPrice,
|
||||
additionalPriceCurrency,
|
||||
currency: CurrencyEnum.POINTS,
|
||||
currency: pointsCurrency ?? CurrencyEnum.POINTS,
|
||||
price: redemption.localPrice.pointsPerStay,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user