feat: bedtypes is selectable again
This commit is contained in:
committed by
Michael Zetterberg
parent
f62723c6e5
commit
afb37d0cc5
@@ -1,39 +0,0 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type {
|
||||
priceSchema,
|
||||
productTypePriceSchema,
|
||||
} from "@/server/routers/hotels/schemas/productTypePrice"
|
||||
import type { RoomPackage } from "./roomFilter"
|
||||
|
||||
export type ProductPrice = z.output<typeof productTypePriceSchema>
|
||||
export type RoomPriceSchema = z.output<typeof priceSchema>
|
||||
|
||||
export type FlexibilityOptionProps = {
|
||||
features: RoomConfiguration["features"]
|
||||
paymentTerm: string
|
||||
petRoomPackage: RoomPackage | undefined
|
||||
priceInformation?: Array<string>
|
||||
product: Product | undefined
|
||||
roomType: RoomConfiguration["roomType"]
|
||||
roomTypeCode: RoomConfiguration["roomTypeCode"]
|
||||
title: string
|
||||
rateName?: string // Obtained in case of booking code and redemption rates
|
||||
}
|
||||
|
||||
export interface FlexibilityOptionVoucherProps
|
||||
extends Omit<FlexibilityOptionProps, "| product"> {
|
||||
product: Product
|
||||
}
|
||||
export type FlexibilityOptionChequeProps = FlexibilityOptionVoucherProps
|
||||
|
||||
export interface PriceListProps {
|
||||
publicPrice: ProductPrice
|
||||
memberPrice: ProductPrice
|
||||
petRoomPackage?: RoomPackage
|
||||
rateName?: string // Obtained in case of booking code and redemption rates
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Packages } from "@/types/requests/packages"
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
@@ -12,5 +12,5 @@ export interface SharedRateCardProps
|
||||
extends Pick<RoomConfiguration, "roomTypeCode"> {
|
||||
handleSelectRate: (product: Product) => void
|
||||
nights: number
|
||||
petRoomPackage: NonNullable<Packages>[number] | undefined
|
||||
petRoomPackage: Package | undefined
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ export enum RoomPackageCodeEnum {
|
||||
export interface DefaultFilterOptions {
|
||||
code: RoomPackageCodeEnum
|
||||
description: string
|
||||
itemCode: string | undefined
|
||||
}
|
||||
|
||||
export type FilterValues = {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
import type { RoomConfiguration } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
import type { RoomPriceSchema } from "./flexibilityOption"
|
||||
|
||||
export type RoomListItemProps = {
|
||||
roomConfiguration: RoomConfiguration
|
||||
@@ -10,19 +7,9 @@ export type RoomListItemProps = {
|
||||
|
||||
export type RoomListItemImageProps = Pick<
|
||||
RoomConfiguration,
|
||||
"features" | "roomType" | "roomTypeCode" | "roomsLeft"
|
||||
>
|
||||
|
||||
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
|
||||
|
||||
export type CalculatePricesPerNightProps = {
|
||||
publicLocalPrice: RoomPriceSchema
|
||||
memberLocalPrice: RoomPriceSchema
|
||||
publicRequestedPrice: RoomPriceSchema | null
|
||||
memberRequestedPrice: RoomPriceSchema | null
|
||||
petRoomLocalPrice?: RoomPackagePriceSchema
|
||||
petRoomRequestedPrice?: RoomPackagePriceSchema
|
||||
nights: number
|
||||
"roomType" | "roomTypeCode" | "roomsLeft"
|
||||
> & {
|
||||
roomPackages: Package[]
|
||||
}
|
||||
|
||||
export interface RoomSizeProps {
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import type { HotelData } from "@/types/hotel"
|
||||
import type { ChildrenInRoom } from "@/utils/hotelSearchDetails"
|
||||
import type { SelectRateSearchParams } from "./selectRate"
|
||||
|
||||
export interface RoomsContainerProps {
|
||||
adultArray: number[]
|
||||
export interface RoomsContainerProps
|
||||
extends Pick<HotelData, "roomCategories">,
|
||||
Pick<HotelData["hotel"], "hotelType" | "vat"> {
|
||||
booking: SelectRateSearchParams
|
||||
bookingCode?: string
|
||||
childArray: ChildrenInRoom
|
||||
fromDate: Date
|
||||
hotelData: HotelData
|
||||
isUserLoggedIn: boolean
|
||||
toDate: Date
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { RateEnum } from "@/types/enums/rate"
|
||||
import type { PackageEnum, Packages } from "@/types/requests/packages"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { ChildBedMapEnum } from "../../bookingWidget/enums"
|
||||
import type { RoomPackageCodeEnum } from "./roomFilter"
|
||||
|
||||
export interface Child {
|
||||
bed: ChildBedMapEnum
|
||||
@@ -13,9 +13,10 @@ export interface Child {
|
||||
|
||||
export interface Room {
|
||||
adults: number
|
||||
bookingCode?: string
|
||||
childrenInRoom?: Child[]
|
||||
counterRateCode: string
|
||||
packages?: RoomPackageCodeEnum[]
|
||||
packages?: PackageEnum[]
|
||||
rateCode: string
|
||||
roomTypeCode: string
|
||||
}
|
||||
@@ -32,7 +33,7 @@ export interface SelectRateSearchParams {
|
||||
|
||||
export type Rate = {
|
||||
features: RoomConfiguration["features"]
|
||||
packages: RoomPackageCodeEnum[]
|
||||
packages: NonNullable<Packages>
|
||||
priceName?: string
|
||||
priceTerm?: string
|
||||
product: Product
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
import type { RatesState, SelectedRoom } from "@/types/stores/rates"
|
||||
|
||||
export interface RoomContextValue extends Omit<SelectedRoom, "actions"> {
|
||||
actions: Omit<
|
||||
SelectedRoom["actions"],
|
||||
"appendRegularRates" | "addRoomFeatures"
|
||||
>
|
||||
actions: SelectedRoom["actions"]
|
||||
isActiveRoom: boolean
|
||||
isFetchingAdditionalRate: boolean
|
||||
isFetchingRoomFeatures: boolean
|
||||
isMainRoom: boolean
|
||||
petRoomPackage: Package | undefined
|
||||
roomAvailability:
|
||||
| NonNullable<RatesState["roomsAvailability"]>[number]
|
||||
| undefined
|
||||
roomPackages: Package[]
|
||||
roomNr: number
|
||||
totalRooms: number
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { Packages } from "@/types/requests/packages"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { SelectRateSearchParams } from "../components/hotelReservation/selectRate/selectRate"
|
||||
import type { AvailabilityError } from "../stores/rates"
|
||||
@@ -8,7 +7,6 @@ export interface RatesProviderProps extends React.PropsWithChildren {
|
||||
booking: SelectRateSearchParams
|
||||
hotelType: string | undefined
|
||||
isUserLoggedIn: boolean
|
||||
packages: Packages | null
|
||||
roomCategories: Room[]
|
||||
roomsAvailability: (RoomsAvailability | AvailabilityError)[] | undefined
|
||||
vat: number
|
||||
|
||||
@@ -6,6 +6,8 @@ import type {
|
||||
roomPackagesInputSchema,
|
||||
} from "@/server/routers/hotels/input"
|
||||
import type { packagesSchema } from "@/server/routers/hotels/output"
|
||||
import type { RoomPackageCodeEnum } from "../components/hotelReservation/selectRate/roomFilter"
|
||||
import type { BreakfastPackageEnum } from "../enums/breakfast"
|
||||
|
||||
export interface BreackfastPackagesInput
|
||||
extends z.input<typeof breakfastPackageInputSchema> {}
|
||||
@@ -17,3 +19,6 @@ export interface PackagesInput
|
||||
extends z.input<typeof roomPackagesInputSchema> {}
|
||||
|
||||
export type Packages = z.output<typeof packagesSchema>
|
||||
export type Package = NonNullable<Packages>[number]
|
||||
|
||||
export type PackageEnum = BreakfastPackageEnum | RoomPackageCodeEnum
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
import type { ReadonlyURLSearchParams } from "next/navigation"
|
||||
|
||||
import type {
|
||||
DefaultFilterOptions,
|
||||
RoomPackageCodeEnum,
|
||||
} from "@/types/components/hotelReservation/selectRate/roomFilter"
|
||||
import type { DefaultFilterOptions } from "@/types/components/hotelReservation/selectRate/roomFilter"
|
||||
import type {
|
||||
Rate,
|
||||
Room as RoomBooking,
|
||||
SelectRateSearchParams,
|
||||
} from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { Packages } from "@/types/requests/packages"
|
||||
import type { Package, PackageEnum } from "@/types/requests/packages"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
@@ -24,18 +19,17 @@ export interface AvailabilityError {
|
||||
}
|
||||
|
||||
interface Actions {
|
||||
appendRegularRates: (roomConfigurations: RoomConfiguration[]) => void
|
||||
addRoomFeatures: (
|
||||
roomFeatures: {
|
||||
roomTypeCode: RoomConfiguration["roomTypeCode"]
|
||||
features: RoomConfiguration["features"]
|
||||
}[]
|
||||
appendRegularRates: (
|
||||
roomConfigurations: RoomConfiguration[] | undefined
|
||||
) => void
|
||||
closeSection: () => void
|
||||
modifyRate: () => void
|
||||
closeSection: VoidFunction
|
||||
modifyRate: VoidFunction
|
||||
removeSelectedPackage: (code: PackageEnum) => void
|
||||
removeSelectedPackages: VoidFunction
|
||||
selectFilter: (filter: BookingCodeFilterEnum) => void
|
||||
togglePackages: (codes: RoomPackageCodeEnum[]) => void
|
||||
selectPackages: (codes: PackageEnum[]) => void
|
||||
selectRate: (rate: SelectedRate) => void
|
||||
updateRooms: (rooms: RoomConfiguration[] | undefined) => void
|
||||
}
|
||||
|
||||
export interface SelectedRate {
|
||||
@@ -48,27 +42,29 @@ export interface SelectedRate {
|
||||
export interface SelectedRoom {
|
||||
actions: Actions
|
||||
bookingRoom: RoomBooking
|
||||
isFetchingAdditionalRate: boolean
|
||||
isFetchingPackages: boolean
|
||||
rooms: RoomConfiguration[]
|
||||
selectedFilter: BookingCodeFilterEnum | undefined
|
||||
selectedPackages: RoomPackageCodeEnum[]
|
||||
selectedPackages: Package[]
|
||||
selectedRate: SelectedRate | null
|
||||
}
|
||||
|
||||
export interface RatesState {
|
||||
activeRoom: number
|
||||
booking: SelectRateSearchParams
|
||||
packageOptions: DefaultFilterOptions[]
|
||||
hotelType: string | undefined
|
||||
isRedemptionBooking: boolean
|
||||
isUserLoggedIn: boolean
|
||||
packages: NonNullable<Packages>
|
||||
packageOptions: DefaultFilterOptions[]
|
||||
pathname: string
|
||||
petRoomPackage: NonNullable<Packages>[number] | undefined
|
||||
rateSummary: Array<Rate | null>
|
||||
rooms: SelectedRoom[]
|
||||
roomCategories: Room[]
|
||||
roomConfigurations: RoomConfiguration[][]
|
||||
roomsPackages: Package[][]
|
||||
roomsAvailability: (RoomsAvailability | AvailabilityError)[] | undefined
|
||||
searchParams: ReadonlyURLSearchParams
|
||||
searchParams: URLSearchParams
|
||||
vat: number
|
||||
}
|
||||
|
||||
@@ -78,7 +74,6 @@ export interface InitialState
|
||||
| "booking"
|
||||
| "hotelType"
|
||||
| "isUserLoggedIn"
|
||||
| "packages"
|
||||
| "pathname"
|
||||
| "roomCategories"
|
||||
| "roomsAvailability"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import {
|
||||
type getHotelsByHotelIdsAvailabilityInputSchema,
|
||||
type hotelsAvailabilityInputSchema,
|
||||
type roomsCombinedAvailabilityInputSchema,
|
||||
type selectedRoomAvailabilityInputSchema,
|
||||
} from "@/server/routers/hotels/input"
|
||||
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
enterDetailsRoomsAvailabilityInputSchema,
|
||||
getHotelsByHotelIdsAvailabilityInputSchema,
|
||||
hotelsAvailabilityInputSchema,
|
||||
selectRateRoomsAvailabilityInputSchema,
|
||||
} from "@/server/routers/hotels/input"
|
||||
import type { hotelsAvailabilitySchema } from "@/server/routers/hotels/output"
|
||||
import type { productTypeSchema } from "@/server/routers/hotels/schemas/availability/productType"
|
||||
import type {
|
||||
@@ -23,12 +22,15 @@ export type HotelsAvailabilityInputSchema = z.output<
|
||||
export type HotelsByHotelIdsAvailabilityInputSchema = z.output<
|
||||
typeof getHotelsByHotelIdsAvailabilityInputSchema
|
||||
>
|
||||
export type RoomsCombinedAvailabilityInputSchema = z.output<
|
||||
typeof roomsCombinedAvailabilityInputSchema
|
||||
export type RoomsAvailabilityInputSchema = z.input<
|
||||
typeof selectRateRoomsAvailabilityInputSchema
|
||||
>
|
||||
export type SelectedRoomAvailabilitySchema = z.output<
|
||||
typeof selectedRoomAvailabilityInputSchema
|
||||
export type RoomsAvailabilityInputRoom =
|
||||
RoomsAvailabilityInputSchema["booking"]["rooms"][number]
|
||||
export type RoomsAvailabilityExtendedInputSchema = z.input<
|
||||
typeof enterDetailsRoomsAvailabilityInputSchema
|
||||
>
|
||||
|
||||
export type ProductType = z.output<typeof productTypeSchema>
|
||||
export type ProductTypePrices = z.output<typeof productTypePriceSchema>
|
||||
export type ProductTypePoints = z.output<typeof productTypePointsSchema>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { rateSchema } from "@/server/routers/hotels/schemas/rate"
|
||||
|
||||
export type Rate = z.output<typeof rateSchema>
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { RouterOutput } from "@/lib/trpc/client"
|
||||
import type { roomsAvailabilitySchema } from "@/server/routers/hotels/output"
|
||||
import type { roomConfigurationSchema } from "@/server/routers/hotels/schemas/roomAvailability/configuration"
|
||||
import type {
|
||||
@@ -13,10 +12,6 @@ import type {
|
||||
} from "@/server/routers/hotels/schemas/roomAvailability/product"
|
||||
import type { rateDefinitionSchema } from "@/server/routers/hotels/schemas/roomAvailability/rateDefinition"
|
||||
|
||||
export type RoomAvailability = NonNullable<
|
||||
RouterOutput["hotel"]["availability"]["room"]
|
||||
>
|
||||
|
||||
export type CorporateChequeProduct = z.output<typeof corporateChequeProduct>
|
||||
export type PriceProduct = z.output<typeof priceProduct>
|
||||
export type RedemptionProduct = z.output<typeof redemptionProduct>
|
||||
|
||||
Reference in New Issue
Block a user