Merged in fix/SW-2236-remove-modify-for-save (pull request #1771)

fix(SW-2236): show modify by only if changable

* fix(SW-2236): show modify by only if changable


Approved-by: Niclas Edenvin
This commit is contained in:
Bianca Widstam
2025-04-09 14:09:23 +00:00
parent 6bbe80526e
commit e6aa177e6f
4 changed files with 70 additions and 51 deletions

View File

@@ -1,4 +1,4 @@
import { ChildBedTypeEnum } from "@/constants/booking"
import { CancellationRuleEnum, ChildBedTypeEnum } from "@/constants/booking"
export function formatChildBedPreferences({
childrenAges,
@@ -61,3 +61,10 @@ export function formatChildBedPreferences({
// Filter out any null values and join the results
return `[${preferences.filter((pref) => typeof pref === "string").join(", ")}]`
}
export function hasModifiableRate(cancellationRule: string | null): boolean {
return (
cancellationRule === CancellationRuleEnum.CancellableBefore6PM ||
cancellationRule === CancellationRuleEnum.Changeable
)
}