Merged in fix/BOOK-584-strikethrough-regulare-price (pull request #3374)

fix(BOOK-584): multiple nights did not show strikethrough price, wrong calculation for regular price per stay

* fix(BOOK-548): multiple nights did not show strikethrough price, wrong calculation for regular price per stay

* fix(BOOK-584): fix test, regularPrice first compare with pricePerStay


Approved-by: Anton Gunnarsson
This commit is contained in:
Bianca Widstam
2025-12-19 08:19:19 +00:00
parent b9a62b5280
commit 96b4e5a254
2 changed files with 21 additions and 21 deletions

View File

@@ -479,7 +479,7 @@ type RegularRoomRequestedPrice = {
pricePerStay: number
}
export function getRegularPrice(
export function getTotalRegularPrice(
rooms: RegularPriceCalculationRoom[],
isMember: boolean,
nights: number
@@ -539,13 +539,13 @@ export function getRegularPrice(
useMemberRate: !!useMemberRate,
regularMemberPrice: memberRate
? {
pricePerStay: memberRate.localPrice.pricePerNight,
pricePerStay: memberRate.localPrice.pricePerStay,
regularPricePerStay: memberRate.localPrice.regularPricePerStay,
}
: undefined,
regularPublicPrice: publicRate
? {
pricePerStay: publicRate.localPrice.pricePerNight,
pricePerStay: publicRate.localPrice.pricePerStay,
regularPricePerStay: publicRate.localPrice.regularPricePerStay,
}
: undefined,
@@ -609,7 +609,7 @@ export function getTotalPrice(
"member" in x.roomRate || "public" in x.roomRate
)
if (regularRooms.length > 0) {
return getRegularPrice(regularRooms, isMember, nights)
return getTotalRegularPrice(regularRooms, isMember, nights)
}
logger.warn(