Merged in feature/SW-3616-partner-points-my-stay (pull request #3407)
Feature/SW-3616 partner points my stay * feat(SW-3616): display partner points in my stays * null check roomPointType * Lowercase POINTS in my stay * include other than Scandic points when displaying price details modal Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -71,6 +71,16 @@ export function calculateTotalPrice(rooms: Room[], currency: CurrencyEnum) {
|
||||
break
|
||||
case PriceTypeEnum.points:
|
||||
{
|
||||
if (
|
||||
room.roomPoints &&
|
||||
room.roomPointType &&
|
||||
room.roomPointType !== "Scandic"
|
||||
) {
|
||||
total.local.currency =
|
||||
roomPointTypeToCurrencyMap[room.roomPointType]
|
||||
total.local.price = total.local.price + room.roomPoints
|
||||
break
|
||||
}
|
||||
total.local.currency = CurrencyEnum.POINTS
|
||||
total.local.price = total.local.price + room.totalPoints
|
||||
}
|
||||
@@ -135,3 +145,11 @@ export function calculateTotalPrice(rooms: Room[], currency: CurrencyEnum) {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const roomPointTypeToCurrencyMap: Record<
|
||||
NonNullable<Room["roomPointType"]>,
|
||||
CurrencyEnum
|
||||
> = {
|
||||
Scandic: CurrencyEnum.POINTS,
|
||||
EuroBonus: CurrencyEnum.EUROBONUS,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user