feat: update getHotel to use real hotel api endpoint, support for service tokens, type modifications

This commit is contained in:
Chuma McPhoy
2024-07-24 14:27:17 +02:00
parent 7393347f99
commit 1ff6cd267d
14 changed files with 195 additions and 89 deletions

View File

@@ -1,13 +1,16 @@
import { z } from "zod"
import { getHotelDataSchema,RoomSchema } from "@/server/routers/hotels/output"
import { getHotelDataSchema, RoomSchema } from "@/server/routers/hotels/output"
export type HotelData = z.infer<typeof getHotelDataSchema>
export type Hotel = HotelData["data"]["attributes"]
export type HotelAddress = HotelData["data"]["attributes"]["address"]
export type HotelLocation = HotelData["data"]["attributes"]["location"]
type HotelRatings = HotelData["data"]["attributes"]["ratings"]
export type HotelTripAdvisor =
HotelData["data"]["attributes"]["ratings"]["tripAdvisor"]
| NonNullable<HotelRatings>["tripAdvisor"]
| undefined
export type RoomData = z.infer<typeof RoomSchema>