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:
Joakim Jäderberg
2026-01-12 09:24:04 +00:00
parent d371d45fd2
commit 488a396cfa
5 changed files with 260 additions and 29 deletions

View File

@@ -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,
}