Merged in feat(SW-2083)-missing-booking-codes-scenarios-my-stay (pull request #1680)

Feat(SW-2083) missing booking codes scenarios my stay

* feat(SW-2083) Show points instead of reward nights

* feat(SW-2083) added support for cheque and voucher for totalPrice


Approved-by: Niclas Edenvin
This commit is contained in:
Pontus Dreij
2025-03-31 11:42:47 +00:00
parent 7434f30c20
commit b48053b8b4
23 changed files with 240 additions and 33 deletions

View File

@@ -7,6 +7,7 @@ interface ModificationConditions {
isNotPast: boolean
isNotCancelled: boolean
isNotPrePaid: boolean
isNotRewardNight: boolean
}
interface GuaranteeConditions {
@@ -25,17 +26,20 @@ export function checkDateModifiable({
datetimeIsInThePast,
isCancelled,
isPrePaid,
isRewardNight,
}: {
canChangeDate: boolean
datetimeIsInThePast: boolean
isCancelled: boolean
isPrePaid: boolean
isRewardNight: boolean
}): boolean {
const conditions: ModificationConditions = {
canModify: canChangeDate,
isNotPast: !datetimeIsInThePast,
isNotCancelled: !isCancelled,
isNotPrePaid: !isPrePaid,
isNotRewardNight: !isRewardNight,
}
return Object.values(conditions).every(Boolean)