feat(SW-251): use availability to get hotel

This commit is contained in:
Fredrik Thorsson
2024-09-09 10:02:35 +02:00
parent 024a095dc6
commit 8c530658c5
7 changed files with 64 additions and 120 deletions

View File

@@ -552,33 +552,3 @@ const rate = z.object({
export const getRatesSchema = z.array(rate)
export type Rate = z.infer<typeof rate>
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.optional(),
detailedFacilities: z.array(detailedFacilitySchema),
isActive: z.boolean(),
}),
id: z.string(),
language: z.unknown(),
hotelInformationSystemId: z.number(),
type: z.string(),
})
),
})
export const getHotelFilterSchema = hotelFilterSchema
export type HotelFilter = z.infer<typeof hotelFilterSchema>
export type HotelId = HotelFilter["data"][number]["id"]
export type HotelFilters =
HotelFilter["data"][number]["attributes"]["detailedFacilities"]