Merged in feat/SW-2033-implement-new-room-feature-request (pull request #1665)

feat(SW-2033): Added new route for fetching room features, and merged the data with existing availability data

* feat(SW-2033): Added new route for fetching room features, and merged the data with existing availability data

* fix: issue with total price not including room features

* fix: add return null

* fix

* fix

* fixes from PR feedback


Approved-by: Arvid Norlin
This commit is contained in:
Tobias Johansson
2025-03-31 11:20:49 +00:00
parent 81f579bbfe
commit 7434f30c20
9 changed files with 232 additions and 12 deletions

View File

@@ -2,6 +2,8 @@ import { z } from "zod"
import { Lang } from "@/constants/languages"
import { nullableArrayObjectValidator } from "@/utils/zod/arrayValidator"
import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { Country } from "@/types/enums/country"
@@ -159,3 +161,21 @@ export const getHotelsByCityIdentifierInput = z.object({
export const getLocationsInput = z.object({
lang: z.nativeEnum(Lang),
})
export const roomFeaturesInputSchema = z.object({
hotelId: z.string(),
startDate: z.string(),
endDate: z.string(),
adultsCount: z.array(z.number()),
childArray: z
.array(
nullableArrayObjectValidator(
z.object({
age: z.number(),
bed: z.nativeEnum(ChildBedMapEnum),
})
)
)
.nullable(),
roomFeatureCode: z.array(z.nativeEnum(RoomPackageCodeEnum)).optional(),
})