Merged in feat/SW-1333-hotel-endpoint (pull request #1206)

Feat(SW-133): Add additionalData endpoint

Approved-by: Erik Tiekstra
Approved-by: Fredrik Thorsson
This commit is contained in:
Matilda Landström
2025-01-27 11:39:13 +00:00
parent bf76c6277f
commit 577a4ca35e
17 changed files with 239 additions and 50 deletions

View File

@@ -5,7 +5,7 @@ export function getTypeSpecificInformation(
contentType: HotelListing["contentType"], contentType: HotelListing["contentType"],
hotel: Hotel hotel: Hotel
) { ) {
const { restaurantsOverviewPage, images } = hotel.hotelContent const { images } = hotel.hotelContent
const { descriptions, meetingDescription } = hotel.hotelContent.texts const { descriptions, meetingDescription } = hotel.hotelContent.texts
const hotelData = { const hotelData = {
description: descriptions.short, description: descriptions.short,
@@ -24,8 +24,8 @@ export function getTypeSpecificInformation(
const restaurantImage = hotel.restaurantImages?.heroImages[0] const restaurantImage = hotel.restaurantImages?.heroImages[0]
return { return {
description: description:
restaurantsOverviewPage.restaurantsContentDescriptionShort || hotel.hotelContent.restaurantsOverviewPage
hotelData.description, .restaurantsContentDescriptionShort || hotelData.description,
imageSrc: restaurantImage?.imageSizes.small || hotelData.imageSrc, imageSrc: restaurantImage?.imageSizes.small || hotelData.imageSrc,
altText: restaurantImage?.metaData.altText || hotelData.altText, altText: restaurantImage?.metaData.altText || hotelData.altText,
} }

View File

@@ -41,7 +41,7 @@ import styles from "./hotelPage.module.css"
import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities" import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities"
import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage" import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation" import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
import type { Facility } from "@/types/hotel" import type { AdditionalData, Facility } from "@/types/hotel"
import { PageContentTypeEnum } from "@/types/requests/contentType" import { PageContentTypeEnum } from "@/types/requests/contentType"
export default async function HotelPage({ hotelId }: HotelPageProps) { export default async function HotelPage({ hotelId }: HotelPageProps) {
@@ -63,12 +63,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
name, name,
address, address,
pointsOfInterest, pointsOfInterest,
gallery,
specialAlerts, specialAlerts,
healthAndWellness,
restaurantImages,
conferencesAndMeetings,
hotelRoomElevatorPitchText,
hotelContent, hotelContent,
detailedFacilities, detailedFacilities,
healthFacilities, healthFacilities,
@@ -79,8 +74,18 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
ratings, ratings,
parking, parking,
} = hotelData.data.attributes } = hotelData.data.attributes
const roomCategories = hotelData.included?.rooms || [] const roomCategories = hotelData.included.rooms || []
const restaurants = hotelData.included?.restaurants || [] const restaurants = hotelData.included.restaurants || []
const additionalData =
hotelData.included.additionalData || ({} as AdditionalData)
const {
healthAndWellness,
restaurantImages,
conferencesAndMeetings,
hotelRoomElevatorPitchText,
gallery,
} = additionalData
const images = gallery?.smallerImages const images = gallery?.smallerImages
const description = hotelContent.texts.descriptions.medium const description = hotelContent.texts.descriptions.medium

View File

@@ -95,7 +95,7 @@ export async function RoomsContainer({
<Rooms <Rooms
availablePackages={packages ?? []} availablePackages={packages ?? []}
roomsAvailability={roomsAvailability} roomsAvailability={roomsAvailability}
roomCategories={hotelData?.included?.rooms ?? []} roomCategories={hotelData?.included.rooms ?? []}
hotelType={hotelData?.data.attributes?.hotelType} hotelType={hotelData?.data.attributes?.hotelType}
isUserLoggedIn={isUserLoggedIn} isUserLoggedIn={isUserLoggedIn}
/> />

View File

@@ -32,7 +32,7 @@ export default function HotelReservationSidePeek({
} }
) )
const selectedRoom = hotelData?.included?.rooms?.find((room) => const selectedRoom = hotelData?.included.rooms?.find((room) =>
room.roomTypes.some((type) => type.code === roomTypeCode) room.roomTypes.some((type) => type.code === roomTypeCode)
) )
@@ -42,6 +42,7 @@ export default function HotelReservationSidePeek({
{hotelData && ( {hotelData && (
<HotelSidePeek <HotelSidePeek
hotel={hotelData.data?.attributes} hotel={hotelData.data?.attributes}
additionalHotelData={hotelData.included.additionalData}
activeSidePeek={activeSidePeek} activeSidePeek={activeSidePeek}
close={close} close={close}
showCTA={showCTA} showCTA={showCTA}

View File

@@ -4,7 +4,6 @@ import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
import Contact from "@/components/HotelReservation/Contact" import Contact from "@/components/HotelReservation/Contact"
import Accordion from "@/components/TempDesignSystem/Accordion" import Accordion from "@/components/TempDesignSystem/Accordion"
import SidePeek from "@/components/TempDesignSystem/SidePeek" import SidePeek from "@/components/TempDesignSystem/SidePeek"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import Accessibility from "./Accordions/Accessibility" import Accessibility from "./Accordions/Accessibility"
@@ -20,6 +19,7 @@ import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
export default function HotelSidePeek({ export default function HotelSidePeek({
hotel, hotel,
additionalHotelData,
activeSidePeek, activeSidePeek,
close, close,
showCTA, showCTA,
@@ -45,19 +45,19 @@ export default function HotelSidePeek({
<Contact hotel={hotel} /> <Contact hotel={hotel} />
<Accordion> <Accordion>
{parking?.length > 0 && <Parking parking={parking} />} {parking?.length > 0 && <Parking parking={parking} />}
{hotel.hotelContent?.restaurantsOverviewPage {additionalHotelData?.restaurantsOverviewPage
?.restaurantsContentDescriptionMedium && ( ?.restaurantsContentDescriptionMedium && (
<Restaurant <Restaurant
restaurantsContentDescriptionMedium={ restaurantsContentDescriptionMedium={
hotel.hotelContent.restaurantsOverviewPage additionalHotelData.restaurantsOverviewPage
.restaurantsContentDescriptionMedium .restaurantsContentDescriptionMedium
} }
/> />
)} )}
{hotel?.accessibilityElevatorPitchText && ( {additionalHotelData?.accessibilityElevatorPitchText && (
<Accessibility <Accessibility
accessibilityElevatorPitchText={ accessibilityElevatorPitchText={
hotel.accessibilityElevatorPitchText additionalHotelData.accessibilityElevatorPitchText
} }
/> />
)} )}

View File

@@ -114,6 +114,9 @@ export namespace endpoints {
export function roomCategories(hotelId: string) { export function roomCategories(hotelId: string) {
return `${hotels}/${hotelId}/roomCategories` return `${hotels}/${hotelId}/roomCategories`
} }
export function additionalData(hotelId: string) {
return `${hotels}/${hotelId}/additionalData`
}
} }
export const locations = `${base.path.hotel}/${version}/${base.enitity.Locations}` export const locations = `${base.path.hotel}/${version}/${base.enitity.Locations}`

View File

@@ -171,6 +171,15 @@ export const getMeetingRooms = cache(
} }
) )
export const getAdditionalData = cache(
async function getMemoizedAdditionalData(input: {
hotelId: string
language: Lang
}) {
return serverClient().hotel.additionalData(input)
}
)
export const getDestinationOverviewPage = cache( export const getDestinationOverviewPage = cache(
async function getMemoizedDestinationOverviewPage() { async function getMemoizedDestinationOverviewPage() {
return serverClient().contentstack.destinationOverviewPage.get() return serverClient().contentstack.destinationOverviewPage.get()

View File

@@ -146,7 +146,7 @@ export const bookingQueryRouter = router({
included: hotelData.included, included: hotelData.included,
}, },
room: getBookedHotelRoom( room: getBookedHotelRoom(
hotelData.included?.rooms, hotelData.included.rooms,
booking.data.roomTypeCode booking.data.roomTypeCode
), ),
} }

View File

@@ -98,3 +98,8 @@ export const getMeetingRoomsInputSchema = z.object({
hotelId: z.string(), hotelId: z.string(),
language: z.string(), language: z.string(),
}) })
export const getAdditionalDataInputSchema = z.object({
hotelId: z.string(),
language: z.string(),
})

View File

@@ -3,6 +3,7 @@ import { z } from "zod"
import { ChildBedTypeEnum, type PaymentMethodEnum } from "@/constants/booking" import { ChildBedTypeEnum, type PaymentMethodEnum } from "@/constants/booking"
import { toLang } from "@/server/utils" import { toLang } from "@/server/utils"
import { additionalDataSchema } from "./schemas/additionalData"
import { imageSchema } from "./schemas/image" import { imageSchema } from "./schemas/image"
import { restaurantSchema } from "./schemas/restaurants" import { restaurantSchema } from "./schemas/restaurants"
import { roomSchema } from "./schemas/room" import { roomSchema } from "./schemas/room"
@@ -12,7 +13,7 @@ import { getPoiGroupByCategoryName } from "./utils"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter" import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { FacilityEnum } from "@/types/enums/facilities" import { FacilityEnum } from "@/types/enums/facilities"
import { PackageTypeEnum } from "@/types/enums/packages" import { PackageTypeEnum } from "@/types/enums/packages"
import type { RestaurantData, RoomData } from "@/types/hotel" import type { AdditionalData, RestaurantData, RoomData } from "@/types/hotel"
const ratingsSchema = z const ratingsSchema = z
.object({ .object({
@@ -119,7 +120,7 @@ const hotelContentSchema = z.object({
restaurantsOverviewPageLink: z.string().optional(), restaurantsOverviewPageLink: z.string().optional(),
restaurantsContentDescriptionShort: z.string().optional(), restaurantsContentDescriptionShort: z.string().optional(),
restaurantsContentDescriptionMedium: z.string().optional(), restaurantsContentDescriptionMedium: z.string().optional(),
}), }), // TODO remove, use new /additionalData endpoint
}) })
const detailedFacilitySchema = z.object({ const detailedFacilitySchema = z.object({
@@ -134,12 +135,12 @@ const detailedFacilitySchema = z.object({
export const facilitySchema = z.object({ export const facilitySchema = z.object({
headingText: z.string().default(""), headingText: z.string().default(""),
heroImages: z.array(imageSchema), heroImages: z.array(imageSchema),
}) }) // TODO remove, use new /additionalData endpoint
export const gallerySchema = z.object({ export const gallerySchema = z.object({
heroImages: z.array(imageSchema), heroImages: z.array(imageSchema),
smallerImages: z.array(imageSchema), smallerImages: z.array(imageSchema),
}) }) // TODO remove, use new /additionalData endpoint
const healthFacilitySchema = z.object({ const healthFacilitySchema = z.object({
type: z.string(), type: z.string(),
@@ -289,16 +290,6 @@ export const parkingSchema = z.object({
pricing: parkingPricingSchema, pricing: parkingPricingSchema,
}) })
const specialNeedSchema = z.object({
name: z.string(),
details: z.string(),
})
const specialNeedGroupSchema = z.object({
name: z.string(),
specialNeeds: z.array(specialNeedSchema),
})
const socialMediaSchema = z.object({ const socialMediaSchema = z.object({
instagram: z.string().optional(), instagram: z.string().optional(),
facebook: z.string().optional(), facebook: z.string().optional(),
@@ -392,11 +383,10 @@ type DetailedFacility = { id: FacilityEnum } & z.infer<
typeof detailedFacilitySchema typeof detailedFacilitySchema
> >
export const hotelAttributesSchema = z.object({ export const hotelAttributesSchema = z.object({
accessibilityElevatorPitchText: z.string().optional(),
address: addressSchema, address: addressSchema,
cityId: z.string(), cityId: z.string(),
cityName: z.string(), cityName: z.string(),
conferencesAndMeetings: facilitySchema.optional(), conferencesAndMeetings: facilitySchema.optional(), // TODO remove, use new /additionalData endpoint
contactInformation: contactInformationSchema, contactInformation: contactInformationSchema,
detailedFacilities: z.array(detailedFacilitySchema).transform( detailedFacilities: z.array(detailedFacilitySchema).transform(
(facilities) => (facilities) =>
@@ -407,13 +397,11 @@ export const hotelAttributesSchema = z.object({
) )
.sort((a, b) => b.sortOrder - a.sortOrder) as DetailedFacility[] .sort((a, b) => b.sortOrder - a.sortOrder) as DetailedFacility[]
), ),
gallery: gallerySchema.optional(), gallery: gallerySchema.optional(), // TODO remove, use new /additionalData endpoint
galleryImages: z.array(imageSchema).optional(), galleryImages: z.array(imageSchema).optional(),
healthAndWellness: facilitySchema.optional(),
healthFacilities: z.array(healthFacilitySchema), healthFacilities: z.array(healthFacilitySchema),
hotelContent: hotelContentSchema, hotelContent: hotelContentSchema,
hotelFacts: hotelFactsSchema, hotelFacts: hotelFactsSchema,
hotelRoomElevatorPitchText: z.string().optional(),
hotelType: z.string().optional(), hotelType: z.string().optional(),
isActive: z.boolean(), isActive: z.boolean(),
isPublished: z.boolean(), isPublished: z.boolean(),
@@ -430,23 +418,26 @@ export const hotelAttributesSchema = z.object({
), ),
ratings: ratingsSchema, ratings: ratingsSchema,
rewardNight: rewardNightSchema, rewardNight: rewardNightSchema,
restaurantImages: facilitySchema.optional(), restaurantImages: facilitySchema.optional(), // TODO remove, use new /additionalData endpoint
socialMedia: socialMediaSchema, socialMedia: socialMediaSchema,
specialAlerts: specialAlertsSchema, specialAlerts: specialAlertsSchema,
specialNeedGroups: z.array(specialNeedGroupSchema),
vat: z.number(), vat: z.number(),
}) })
const includedSchema = z const includedSchema = z
.array(z.union([roomSchema, restaurantSchema])) .array(z.union([roomSchema, restaurantSchema, additionalDataSchema]))
.transform((data) => { .transform((data) => {
const rooms = data.filter((d) => d.type === "roomcategories") as RoomData[] const rooms = data.filter((d) => d.type === "roomcategories") as RoomData[]
const restaurants = data.filter( const restaurants = data.filter(
(d) => d.type === "restaurants" (d) => d.type === "restaurants"
) as RestaurantData[] ) as RestaurantData[]
const additionalData = data.filter(
(d) => d.type === "additionalData"
) as AdditionalData[]
return { return {
rooms, rooms,
restaurants, restaurants,
additionalData,
} }
}) })
@@ -467,7 +458,13 @@ export const getHotelDataSchema = z.object({
}), }),
// NOTE: We can pass an "include" param to the hotel API to retrieve // NOTE: We can pass an "include" param to the hotel API to retrieve
// additional data for an individual hotel. // additional data for an individual hotel.
included: includedSchema.optional(), included: includedSchema.optional().transform((incl) => {
return {
restaurants: incl?.restaurants,
rooms: incl?.rooms,
additionalData: incl?.additionalData[0],
}
}),
}) })
export const childrenSchema = z.object({ export const childrenSchema = z.object({

View File

@@ -16,7 +16,9 @@ import { cache } from "@/utils/cache"
import { getHotelPageUrl } from "../contentstack/hotelPage/utils" import { getHotelPageUrl } from "../contentstack/hotelPage/utils"
import { getVerifiedUser, parsedUser } from "../user/query" import { getVerifiedUser, parsedUser } from "../user/query"
import { additionalDataSchema } from "./schemas/additionalData"
import { import {
getAdditionalDataInputSchema,
getBreakfastPackageInputSchema, getBreakfastPackageInputSchema,
getCityCoordinatesInputSchema, getCityCoordinatesInputSchema,
getHotelDataInputSchema, getHotelDataInputSchema,
@@ -39,6 +41,9 @@ import {
getRoomsAvailabilitySchema, getRoomsAvailabilitySchema,
} from "./output" } from "./output"
import { import {
additionalDataCounter,
additionalDataFailCounter,
additionalDataSuccessCounter,
breakfastPackagesCounter, breakfastPackagesCounter,
breakfastPackagesFailCounter, breakfastPackagesFailCounter,
breakfastPackagesSuccessCounter, breakfastPackagesSuccessCounter,
@@ -86,7 +91,7 @@ export const getHotelData = cache(
async (input: HotelDataInput, serviceToken: string) => { async (input: HotelDataInput, serviceToken: string) => {
const { hotelId, language, isCardOnlyPayment } = input const { hotelId, language, isCardOnlyPayment } = input
const includes = ["RoomCategories", "Restaurants"] // "RoomCategories","NearbyHotels","Restaurants","City", const includes = ["RoomCategories", "Restaurants", "AdditionalData"] //"NearbyHotels","Restaurants","City",
const params = new URLSearchParams({ const params = new URLSearchParams({
hotelId, hotelId,
language, language,
@@ -182,8 +187,10 @@ export const getHotelData = cache(
hotelData.data.attributes.merchantInformationData.alternatePaymentOptions = hotelData.data.attributes.merchantInformationData.alternatePaymentOptions =
[] []
} }
if (hotelData.data.attributes.gallery) {
const smallerImages = hotelData.data.attributes.gallery.smallerImages const gallery = hotelData.included.additionalData?.gallery
if (gallery) {
const smallerImages = gallery.smallerImages
const hotelGalleryImages = const hotelGalleryImages =
hotelData.data.attributes.hotelType === HotelTypeEnum.Signature hotelData.data.attributes.hotelType === HotelTypeEnum.Signature
? smallerImages.slice(0, 10) ? smallerImages.slice(0, 10)
@@ -604,7 +611,7 @@ export const hotelQueryRouter = router({
const bedTypes = availableRoomsInCategory const bedTypes = availableRoomsInCategory
.map((availRoom) => { .map((availRoom) => {
const matchingRoom = hotelData?.included?.rooms const matchingRoom = hotelData?.included.rooms
?.find((room) => ?.find((room) =>
room.roomTypes room.roomTypes
.map((roomType) => roomType.code) .map((roomType) => roomType.code)
@@ -1253,4 +1260,82 @@ export const hotelQueryRouter = router({
return validatedMeetingRooms.data.data return validatedMeetingRooms.data.data
}), }),
additionalData: safeProtectedServiceProcedure
.input(getAdditionalDataInputSchema)
.query(async function ({ ctx, input }) {
const { hotelId, language } = input
const params: Record<string, string | string[]> = {
hotelId,
language,
}
const metricsData = { ...params, hotelId: input.hotelId }
additionalDataCounter.add(1, metricsData)
console.info(
"api.hotels.additionalData start",
JSON.stringify({ query: { hotelId, params } })
)
const apiResponse = await api.get(
api.endpoints.v1.Hotel.Hotels.additionalData(input.hotelId),
{
cache: undefined,
headers: {
Authorization: `Bearer ${ctx.serviceToken}`,
},
next: {
revalidate: env.CACHE_TIME_HOTELS,
},
},
params
)
if (!apiResponse.ok) {
const text = await apiResponse.text()
additionalDataFailCounter.add(1, {
...metricsData,
error_type: "http_error",
error: JSON.stringify({
status: apiResponse.status,
statusText: apiResponse.statusText,
text,
}),
})
console.error(
"api.hotels.additionalData error",
JSON.stringify({
query: { params },
error: {
status: apiResponse.status,
statusText: apiResponse.statusText,
text,
},
})
)
return null
}
const apiJson = await apiResponse.json()
const validatedAdditionalData = additionalDataSchema.safeParse(apiJson)
if (!validatedAdditionalData.success) {
console.error(
"api.hotels.additionalData validation error",
JSON.stringify({
query: { params },
error: validatedAdditionalData.error,
})
)
throw badRequestError()
}
additionalDataSuccessCounter.add(1, {
hotelId,
})
console.info(
"api.hotels.additionalData success",
JSON.stringify({ query: { params } })
)
return validatedAdditionalData.data
}),
}) })

View File

@@ -0,0 +1,67 @@
import { z } from "zod"
import { imageSchema } from "./image"
const specialNeedSchema = z.object({
name: z.string(),
details: z.string(),
})
const specialNeedGroupSchema = z.object({
name: z.string(),
specialNeeds: z.array(specialNeedSchema),
})
export const gallerySchema = z.object({
heroImages: z.array(imageSchema),
smallerImages: z.array(imageSchema),
})
export const facilitySchema = z.object({
headingText: z.string().default(""),
heroImages: z.array(imageSchema),
})
export const restaurantsOverviewPageSchema = z.object({
restaurantsOverviewPageLinkText: z.string().optional(),
restaurantsOverviewPageLink: z.string().optional(),
restaurantsContentDescriptionShort: z.string().optional(),
restaurantsContentDescriptionMedium: z.string().optional(),
})
const extraPageSchema = z.object({
elevatorPitch: z.string().optional(),
mainBody: z.string().optional(),
})
export const additionalDataSchema = z
.object({
attributes: z.object({
name: z.string(),
id: z.string(),
displayWebPage: z.object({
healthGym: z.boolean(),
meetingRoom: z.boolean(),
parking: z.boolean(),
specialNeeds: z.boolean(),
}),
specialNeedGroups: z.array(specialNeedGroupSchema),
gallery: gallerySchema.optional(),
conferencesAndMeetings: facilitySchema.optional(),
healthAndWellness: facilitySchema.optional(),
restaurantImages: facilitySchema.optional(),
restaurantsOverviewPage: restaurantsOverviewPageSchema,
meetingRooms: extraPageSchema,
healthAndFitness: extraPageSchema,
hotelParking: extraPageSchema,
hotelSpecialNeeds: extraPageSchema,
accessibilityElevatorPitchText: z.string().optional(),
hotelRoomElevatorPitchText: z.string().optional(),
}),
type: z.literal("additionalData"),
})
.transform(({ attributes, type }) => ({
...attributes,
type,
id: attributes.id,
}))

View File

@@ -36,6 +36,7 @@ export const restaurantSchema = z
attributes: z.object({ attributes: z.object({
name: z.string(), name: z.string(),
isPublished: z.boolean().default(false), isPublished: z.boolean().default(false),
restaurantPage: z.boolean(),
email: z.string().optional(), email: z.string().optional(),
phoneNumber: z.string().optional(), phoneNumber: z.string().optional(),
externalBreakfast: z externalBreakfast: z

View File

@@ -82,3 +82,13 @@ export const meetingRoomsSuccessCounter = meter.createCounter(
export const meetingRoomsFailCounter = meter.createCounter( export const meetingRoomsFailCounter = meter.createCounter(
"trpc.hotels.meetingRooms-fail" "trpc.hotels.meetingRooms-fail"
) )
export const additionalDataCounter = meter.createCounter(
"trpc.hotels.additionalData"
)
export const additionalDataSuccessCounter = meter.createCounter(
"trpc.hotels.additionalData-success"
)
export const additionalDataFailCounter = meter.createCounter(
"trpc.hotels.additionalData-fail"
)

View File

@@ -1,8 +1,9 @@
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek" import type { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
import { Hotel } from "@/types/hotel" import type { AdditionalData, Hotel } from "@/types/hotel"
export type HotelSidePeekProps = { export type HotelSidePeekProps = {
hotel: Hotel hotel: Hotel
additionalHotelData: AdditionalData | undefined
activeSidePeek: SidePeekEnum activeSidePeek: SidePeekEnum
close: () => void close: () => void
showCTA: boolean showCTA: boolean

View File

@@ -2,11 +2,14 @@ import type { z } from "zod"
import type { import type {
checkinSchema, checkinSchema,
facilitySchema,
getHotelDataSchema, getHotelDataSchema,
parkingSchema, parkingSchema,
pointOfInterestSchema, pointOfInterestSchema,
} from "@/server/routers/hotels/output" } from "@/server/routers/hotels/output"
import type {
additionalDataSchema,
facilitySchema,
} from "@/server/routers/hotels/schemas/additionalData"
import type { imageSchema } from "@/server/routers/hotels/schemas/image" import type { imageSchema } from "@/server/routers/hotels/schemas/image"
import type { import type {
restaurantOpeningHoursSchema, restaurantOpeningHoursSchema,
@@ -36,6 +39,8 @@ export type RestaurantOpeningHours = z.output<
export type GalleryImage = z.infer<typeof imageSchema> export type GalleryImage = z.infer<typeof imageSchema>
export type CheckInData = z.infer<typeof checkinSchema> export type CheckInData = z.infer<typeof checkinSchema>
export type AdditionalData = z.infer<typeof additionalDataSchema>
export type PointOfInterest = z.output<typeof pointOfInterestSchema> export type PointOfInterest = z.output<typeof pointOfInterestSchema>
export enum PointOfInterestGroupEnum { export enum PointOfInterestGroupEnum {

View File

@@ -9,7 +9,7 @@ export interface BookingConfirmation {
booking: BookingConfirmationSchema booking: BookingConfirmationSchema
hotel: Hotel & { hotel: Hotel & {
included?: { included?: {
rooms: RoomData[] rooms: RoomData[] | undefined
} }
} }
room: room: