feat: update getHotel to use real hotel api endpoint, support for service tokens, type modifications
This commit is contained in:
+5
-2
@@ -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>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface ServiceTokenResponse {
|
||||
access_token: string
|
||||
scope?: string
|
||||
token_type: string
|
||||
expires_in: number
|
||||
}
|
||||
Reference in New Issue
Block a user