feat(SW-251): set up filter route

This commit is contained in:
Fredrik Thorsson
2024-09-04 13:44:16 +02:00
parent 21d8a5835a
commit 3f6e2ca06e
5 changed files with 129 additions and 29 deletions

View File

@@ -554,11 +554,29 @@ export const getRatesSchema = z.array(rate)
export type Rate = z.infer<typeof rate>
const hotelFilter = z.object({
roomFacilities: z.array(z.string()),
hotelFacilities: z.array(z.string()),
hotelSurroundings: z.array(z.string()),
const hotelFilterSchema = z.object({
data: z.array(
z.object({
attributes: z.object({
name: z.string(),
operaId: z.string(),
isPublished: z.boolean(),
cityId: z.string(),
cityName: z.string(),
ratings: ratingsSchema,
address: addressSchema,
location: locationSchema,
hotelContent: hotelContentSchema,
detailedFacilities: z.array(detailedFacilitySchema),
isActive: z.boolean(),
}),
id: z.string(),
language: z.unknown(),
hotelInformationSystemId: z.number(),
type: z.string(),
})
),
})
export const getFiltersSchema = hotelFilter
export type HotelFilter = z.infer<typeof hotelFilter>
export const getHotelFilterSchema = hotelFilterSchema
export type HotelFilter = z.infer<typeof hotelFilterSchema>