Files
web/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/utils.ts
Simon.Emanuelsson 85acd3453d Merged in feat/SW-1719-strikethrough-rates (pull request #2266)
Feat/SW-1719 strikethrough rates

* feat(SW-1719): Strikethrough rate if logged in on regular rate cards

* feat(SW-1719): Strikethrough rate if logged in on rate summary

* feat(SW-1719): Strikethrough rate if logged in on mobile rate summary

* feat(SW-1719): Strikethrough rate if logged in on enter details

* feat(SW-1719): Strikethrough rate support for multiple rooms

* feat(SW-1719): booking receipt fixes on confirmation page

* feat(SW-1719): improve initial total price calculation

* feat: harmonize enter details total price to use one and the same function


Approved-by: Michael Zetterberg
2025-06-13 12:01:16 +00:00

26 lines
717 B
TypeScript

import type { RoomRate } from "@/types/components/hotelReservation/enterDetails/details"
export function getMemberPrice(roomRate: RoomRate) {
if ("member" in roomRate && roomRate.member) {
return {
amount: roomRate.member.localPrice.pricePerStay,
currency: roomRate.member.localPrice.currency,
pricePerNight: roomRate.member.localPrice.pricePerNight,
}
}
return null
}
export function getPublicPrice(roomRate: RoomRate) {
if ("public" in roomRate && roomRate.public) {
return {
amount: roomRate.public.localPrice.pricePerStay,
currency: roomRate.public.localPrice.currency,
pricePerNight: roomRate.public.localPrice.pricePerNight,
}
}
return null
}