This creates the alternative hotels page. It is mostly a copy of the select hotel page, and most of the contents of the pages lives under the same component in /components.
Merged in feat/sw-397-alternative-hotels (pull request #1211) Feat/sw 397 alternative hotels * fix(SW-397): create alternative hotels page * update types * Adapt to new changes for fetching data * Make bookingcode optional * Code review fixes Approved-by: Simon.Emanuelsson
This commit is contained in:
@@ -6,3 +6,11 @@ export type AvailabilityInput = {
|
||||
children?: string
|
||||
bookingCode?: string
|
||||
}
|
||||
|
||||
export type AlternativeHotelsAvailabilityInput = {
|
||||
roomStayStartDate: string
|
||||
roomStayEndDate: string
|
||||
adults: number
|
||||
children?: string
|
||||
bookingCode?: string
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import type { Child } from "../selectRate/selectRate"
|
||||
import type { HotelData } from "./hotelCardListingProps"
|
||||
import type { CategorizedFilters, Filter } from "./hotelFilters"
|
||||
import type { SelectHotelSearchParams } from "./selectHotelSearchParams"
|
||||
import type {
|
||||
AlternativeHotelsSearchParams,
|
||||
SelectHotelSearchParams,
|
||||
} from "./selectHotelSearchParams"
|
||||
|
||||
export interface HotelListingProps {
|
||||
hotels: HotelData[]
|
||||
@@ -65,5 +68,6 @@ export interface HotelCardDialogListingProps {
|
||||
}
|
||||
|
||||
export type SelectHotelMapContainerProps = {
|
||||
searchParams: SelectHotelSearchParams
|
||||
searchParams: SelectHotelSearchParams | AlternativeHotelsSearchParams
|
||||
isAlternativeHotels?: boolean
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { HotelData } from "./hotelCardListingProps"
|
||||
|
||||
export type NoAvailabilityAlertProp = {
|
||||
isAllUnavailable: boolean
|
||||
isAlternative?: boolean
|
||||
hotels: HotelData[]
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
import type { CheckInData, Hotel, ParkingData } from "@/types/hotel"
|
||||
import type { HotelLocation } from "@/types/trpc/routers/hotel/locations"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { SelectHotelSearchParams } from "./selectHotelSearchParams"
|
||||
import type {
|
||||
AlternativeHotelsSearchParams,
|
||||
SelectHotelSearchParams,
|
||||
} from "./selectHotelSearchParams"
|
||||
|
||||
export enum AvailabilityEnum {
|
||||
Available = "Available",
|
||||
@@ -42,5 +46,6 @@ export interface SelectHotelProps {
|
||||
params: {
|
||||
lang: Lang
|
||||
}
|
||||
searchParams: SelectHotelSearchParams
|
||||
searchParams: SelectHotelSearchParams | AlternativeHotelsSearchParams
|
||||
isAlternativeHotels?: boolean
|
||||
}
|
||||
|
||||
@@ -5,5 +5,11 @@ export interface SelectHotelSearchParams {
|
||||
fromDate: string
|
||||
toDate: string
|
||||
rooms: Pick<Room, "adults" | "childrenInRoom">[]
|
||||
[key: string]: string | string[] | Pick<Room, "adults" | "childrenInRoom">[]
|
||||
}
|
||||
|
||||
export interface AlternativeHotelsSearchParams {
|
||||
hotel: string
|
||||
fromDate: string
|
||||
toDate: string
|
||||
rooms: Pick<Room, "adults" | "childrenInRoom">[]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod"
|
||||
import type { z } from "zod"
|
||||
|
||||
import { apiLocationsSchema } from "@/server/routers/hotels/output"
|
||||
import type { apiLocationsSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export interface LocationSchema extends z.output<typeof apiLocationsSchema> {}
|
||||
|
||||
@@ -9,3 +9,9 @@ export type Location = Locations[number]
|
||||
|
||||
export type CityLocation = Location & { type: "cities" }
|
||||
export type HotelLocation = Location & { type: "hotels" }
|
||||
|
||||
export function isHotelLocation(
|
||||
location: Location | null
|
||||
): location is HotelLocation {
|
||||
return location?.type === "hotels"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user