feat(SW-251): use parallel fetch for hotels

This commit is contained in:
Fredrik Thorsson
2024-09-11 10:22:01 +02:00
parent 8c530658c5
commit 43e58dcf01
9 changed files with 126 additions and 75 deletions

View File

@@ -0,0 +1,10 @@
export type AvailabilityInput = {
cityId: string
roomStayStartDate: string
roomStayEndDate: string
adults: number
children?: number
promotionCode?: string
reservationProfileType?: string
attachedProfileId?: string
}

View File

@@ -0,0 +1,12 @@
import { AvailabilityPrices } from "@/server/routers/hotels/output"
import { Hotel } from "@/types/hotel"
export type HotelCardListingProps = {
hotelData: HotelData[]
}
export type HotelData = {
hotelData: Hotel | undefined
price: AvailabilityPrices
}

View File

@@ -1,11 +1,5 @@
import {
Availability,
AvailabilityPrices,
} from "@/server/routers/hotels/output"
import { HotelData } from "./hotelCardListingProps"
export type HotelCardProps = {
checkInDate: Availability["data"][number]["attributes"]["checkInDate"]
checkOutDate: Availability["data"][number]["attributes"]["checkOutDate"]
hotelId: Availability["data"][number]["attributes"]["hotelId"]
price: AvailabilityPrices
hotel: HotelData
}