Merged in chore/move-enter-details (pull request #2778)
Chore/move enter details Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -2,7 +2,7 @@ import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
export function getFeatureDescription(
|
||||
export function getRoomFeatureDescription(
|
||||
code: string,
|
||||
description: string,
|
||||
intl: IntlShape
|
||||
|
||||
21
packages/booking-flow/lib/utils/specialRoomType.ts
Normal file
21
packages/booking-flow/lib/utils/specialRoomType.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
|
||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||
import type { Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
|
||||
export function getSpecialRoomType(
|
||||
packages: BookingConfirmation["booking"]["packages"] | Packages | null
|
||||
) {
|
||||
const packageCodes = packages
|
||||
?.filter((pkg) => pkg.code)
|
||||
.map((pkg) => pkg.code)
|
||||
if (packageCodes?.includes(RoomPackageCodeEnum.ACCESSIBILITY_ROOM)) {
|
||||
return "accesibillity"
|
||||
} else if (packageCodes?.includes(RoomPackageCodeEnum.ALLERGY_ROOM)) {
|
||||
return "allergy friendly"
|
||||
} else if (packageCodes?.includes(RoomPackageCodeEnum.PET_ROOM)) {
|
||||
return "pet room"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user