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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user