Files
web/types/hotel.ts
2024-11-11 09:12:44 +01:00

67 lines
1.9 KiB
TypeScript

import { z } from "zod"
import {
facilitySchema,
getHotelDataSchema,
imageSchema,
parkingSchema,
pointOfInterestSchema,
} from "@/server/routers/hotels/output"
import { roomSchema } from "@/server/routers/hotels/schemas/room"
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"]
export type Amenities = HotelData["data"]["attributes"]["detailedFacilities"]
type HotelRatings = HotelData["data"]["attributes"]["ratings"]
export type HotelTripAdvisor =
| NonNullable<HotelRatings>["tripAdvisor"]
| undefined
export type RoomData = z.infer<typeof roomSchema>
export type GalleryImage = z.infer<typeof imageSchema>
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
export enum PointOfInterestCategoryNameEnum {
AIRPORT = "Airport",
AMUSEMENT_PARK = "Amusement park",
BUS_TERMINAL = "Bus terminal",
FAIR = "Fair",
HOSPITAL = "Hospital",
HOTEL = "Hotel",
MARKETING_CITY = "Marketing city",
MUSEUM = "Museum",
NEARBY_COMPANIES = "Nearby companies",
PARKING_GARAGE = "Parking / Garage",
RESTAURANT = "Restaurant",
SHOPPING = "Shopping",
SPORTS = "Sports",
THEATRE = "Theatre",
TOURIST = "Tourist",
TRANSPORTATIONS = "Transportations",
ZOO = "Zoo",
}
export enum PointOfInterestGroupEnum {
PUBLIC_TRANSPORT = "Public transport",
ATTRACTIONS = "Attractions",
BUSINESS = "Business",
LOCATION = "Location",
PARKING = "Parking",
SHOPPING_DINING = "Shopping & Dining",
}
export type ParkingData = z.infer<typeof parkingSchema>
export type Facility = z.infer<typeof facilitySchema> & { id: string }
export type HotelMapContentProps = {
coordinates: { lat: number; lng: number }
pointsOfInterest: PointOfInterest[]
onActivePoiChange?: (poiName: string | null) => void
activePoi?: string | null
}