Merged in fix/refactor-currency-display (pull request #3434)

fix(SW-3616): Handle EuroBonus point type everywhere

* Add tests to formatPrice

* formatPrice

* More work replacing config with api points type

* More work replacing config with api points type

* More fixing with currency

* maybe actually fixed it

* Fix MyStay

* Clean up

* Fix comments

* Merge branch 'master' into fix/refactor-currency-display

* Fix calculateTotalPrice for EB points + SF points + cash


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2026-01-15 09:32:17 +00:00
parent c61ddaf94d
commit 16fbdb7ae0
59 changed files with 729 additions and 282 deletions

View File

@@ -167,7 +167,8 @@ export function DesktopSummary({
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
selectedRates.totalPrice.local.additionalPriceCurrency,
selectedRates.totalPrice.local.pointsType
)}
</p>
</Typography>
@@ -203,7 +204,8 @@ export function DesktopSummary({
selectedRates.totalPrice.requested.currency,
selectedRates.totalPrice.requested.additionalPrice,
selectedRates.totalPrice.requested
.additionalPriceCurrency
.additionalPriceCurrency,
selectedRates.totalPrice.local.pointsType
),
}
)}

View File

@@ -195,7 +195,8 @@ export default function SummaryContent({
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
selectedRates.totalPrice.local.additionalPriceCurrency,
selectedRates.totalPrice.local.pointsType
)}
</span>
</Typography>

View File

@@ -137,7 +137,8 @@ export default function Room({
room.roomPrice.perStay.local.price,
room.roomPrice.perStay.local.currency,
room.roomPrice.perStay.local.additionalPrice,
room.roomPrice.perStay.local.additionalPriceCurrency
room.roomPrice.perStay.local.additionalPriceCurrency,
room.roomPrice.perStay.local.pointsType
)}
</p>
{showDiscounted && room.roomPrice.perStay.local.regularPrice ? (

View File

@@ -100,7 +100,8 @@ export function MobileSummary() {
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
selectedRates.totalPrice.local.additionalPriceCurrency,
selectedRates.totalPrice.local.pointsType
)}
</span>
</Typography>

View File

@@ -1,9 +1,9 @@
"use client"
import { useIntl } from "react-intl"
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import PointsRateCard from "@scandic-hotels/design-system/PointsRateCard"
import { useGetPointsCurrency } from "../../../../../../../bookingFlowConfig/bookingFlowConfigContext"
import { useSelectRateContext } from "../../../../../../../contexts/SelectRate/SelectRateContext"
import { BookingCodeFilterEnum } from "../../../../../../../stores/bookingCode-filter"
import { sumPackages } from "../../../../../../../utils/SelectRate"
@@ -35,7 +35,6 @@ export default function Redemptions({
selectedRates,
} = useSelectRateContext()
const roomNr = roomIndex + 1
const pointsCurrency = useGetPointsCurrency()
// TODO: Replace with context value when we have support for dropdown "Show all rates"
const selectedFilter = BookingCodeFilterEnum.All as BookingCodeFilterEnum
@@ -92,9 +91,10 @@ export default function Redemptions({
price: additionalPrice.toString(),
}
: undefined,
currency: pointsCurrency ?? "PTS",
currency: CurrencyEnum.POINTS,
isDisabled: !r.redemption.hasEnoughPoints,
points: r.redemption.localPrice.pointsPerStay.toString(),
points: r.redemption.localPrice.pointsPerStay,
pointsType: r.redemption.localPrice.pointsType,
rateCode: r.redemption.rateCode,
}
})