fix: clean up hotel and its typings
This commit is contained in:
100
types/hotel.ts
100
types/hotel.ts
@@ -1,66 +1,66 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
checkinSchema,
|
||||
getHotelDataSchema,
|
||||
parkingSchema,
|
||||
pointOfInterestSchema,
|
||||
} from "@/server/routers/hotels/output"
|
||||
import type { hotelSchema } from "@/server/routers/hotels/output"
|
||||
import type { citySchema } from "@/server/routers/hotels/schemas/city"
|
||||
import type { attributesSchema } from "@/server/routers/hotels/schemas/hotel"
|
||||
import type { addressSchema } from "@/server/routers/hotels/schemas/hotel/address"
|
||||
import type { hotelContentSchema } from "@/server/routers/hotels/schemas/hotel/content"
|
||||
import type { detailedFacilitiesSchema } from "@/server/routers/hotels/schemas/hotel/detailedFacility"
|
||||
import type { checkinSchema } from "@/server/routers/hotels/schemas/hotel/facts"
|
||||
import type { nearbyHotelsSchema } from "@/server/routers/hotels/schemas/hotel/include/nearbyHotels"
|
||||
import type { restaurantsSchema } from "@/server/routers/hotels/schemas/hotel/include/restaurants"
|
||||
import type { transformRoomCategories } from "@/server/routers/hotels/schemas/hotel/include/roomCategories"
|
||||
import type { locationSchema } from "@/server/routers/hotels/schemas/hotel/location"
|
||||
import type { parkingSchema } from "@/server/routers/hotels/schemas/hotel/parking"
|
||||
import type { pointOfInterestSchema } from "@/server/routers/hotels/schemas/hotel/poi"
|
||||
import type { ratingsSchema } from "@/server/routers/hotels/schemas/hotel/rating"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import { restaurantOpeningHoursSchema } from "@/server/routers/hotels/schemas/restaurants"
|
||||
import { healthFacilitySchema } from "@/server/routers/hotels/schemas/hotel/healthFacilities"
|
||||
import type {
|
||||
additionalDataSchema,
|
||||
extraPageSchema,
|
||||
facilitySchema,
|
||||
transformAdditionalData,
|
||||
} from "@/server/routers/hotels/schemas/additionalData"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import type {
|
||||
restaurantOpeningHoursSchema,
|
||||
restaurantSchema,
|
||||
} from "@/server/routers/hotels/schemas/restaurants"
|
||||
import type { roomSchema } from "@/server/routers/hotels/schemas/room"
|
||||
|
||||
export type HotelData = z.output<typeof getHotelDataSchema>
|
||||
export type HotelData = z.output<typeof hotelSchema>
|
||||
|
||||
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"]
|
||||
export type HealthFacilities =
|
||||
HotelData["data"]["attributes"]["healthFacilities"]
|
||||
export type Amenities = z.output<typeof detailedFacilitiesSchema>
|
||||
export type CheckInData = z.output<typeof checkinSchema>
|
||||
type CitySchema = z.output<typeof citySchema>
|
||||
export type City = Pick<CitySchema, "id" | "type"> & CitySchema["attributes"]
|
||||
export type Facility = z.output<typeof facilitySchema> & { id: string }
|
||||
export type GalleryImage = z.output<typeof imageSchema>
|
||||
export type HealthFacility = z.output<typeof healthFacilitySchema>
|
||||
export type HealthFacilities = HealthFacility[]
|
||||
export type Hotel = z.output<typeof attributesSchema>
|
||||
export type HotelAddress = z.output<typeof addressSchema>
|
||||
export type HotelContent = z.output<typeof hotelContentSchema>
|
||||
export type HotelLocation = z.output<typeof locationSchema>
|
||||
export type HotelRatings = z.output<typeof ratingsSchema>
|
||||
type NearbyHotelsSchema = z.output<typeof nearbyHotelsSchema>
|
||||
export type NearbyHotel = Pick<NearbyHotelsSchema, "id" | "type"> &
|
||||
NearbyHotelsSchema["attributes"]
|
||||
export type Parking = z.output<typeof parkingSchema>
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
type RestaurantSchema = z.output<typeof restaurantsSchema>
|
||||
export type RestaurantOpeningHours = z.output<typeof restaurantOpeningHoursSchema>
|
||||
export type Restaurant = Pick<RestaurantSchema, "id" | "type"> &
|
||||
RestaurantSchema["attributes"]
|
||||
export type Room = ReturnType<typeof transformRoomCategories>
|
||||
|
||||
type HotelRatings = HotelData["data"]["attributes"]["ratings"]
|
||||
export type HotelMapContentProps = {
|
||||
activePoi?: string | null
|
||||
coordinates: { lat: number; lng: number }
|
||||
onActivePoiChange?: (poiName: string | null) => void
|
||||
pointsOfInterest: PointOfInterest[]
|
||||
}
|
||||
export type HotelTripAdvisor =
|
||||
| NonNullable<HotelRatings>["tripAdvisor"]
|
||||
| undefined
|
||||
|
||||
export type RoomData = z.infer<typeof roomSchema>
|
||||
export type RestaurantData = z.output<typeof restaurantSchema>
|
||||
export type RestaurantOpeningHours = z.output<
|
||||
typeof restaurantOpeningHoursSchema
|
||||
>
|
||||
export type GalleryImage = z.infer<typeof imageSchema>
|
||||
export type CheckInData = z.infer<typeof checkinSchema>
|
||||
export type AdditionalData = ReturnType<typeof transformAdditionalData>
|
||||
|
||||
export type AdditionalData = z.infer<typeof additionalDataSchema>
|
||||
export type ExtraPageSchema = z.output<typeof extraPageSchema>
|
||||
|
||||
export type ExtraPageSchema = z.infer<typeof extraPageSchema>
|
||||
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user