feat(SW-1012): Started implementing restaurant data

This commit is contained in:
Erik Tiekstra
2024-12-02 13:47:05 +01:00
committed by Fredrik Thorsson
parent 05006506f0
commit 63a77b215d
17 changed files with 329 additions and 13 deletions

View File

@@ -0,0 +1,23 @@
import type { RouterOutput } from "@/lib/trpc/client"
export function getBookedHotelRoom(
hotel: RouterOutput["booking"]["confirmation"]["hotel"],
roomTypeCode: string
) {
const room = hotel.included?.rooms?.find((include) => {
return include.roomTypes.find((roomType) => roomType.code === roomTypeCode)
})
if (!room) {
return null
}
const bedType = room.roomTypes.find(
(roomType) => roomType.code === roomTypeCode
)
if (!bedType) {
return null
}
return {
...room,
bedType,
}
}