feat: add Price details modal

This commit is contained in:
Arvid Norlin
2024-12-04 16:40:45 +01:00
parent df1e4da001
commit 0c7c6ea21a
24 changed files with 382 additions and 60 deletions
@@ -0,0 +1,3 @@
export interface PriceDetailsTableProps {
roomType: string
}
+3 -2
View File
@@ -1,7 +1,7 @@
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
import { BookingData } from "@/types/components/hotelReservation/enterDetails/bookingData"
import type { BookingData } from "@/types/components/hotelReservation/enterDetails/bookingData"
import type { BreakfastPackage } from "@/types/components/hotelReservation/enterDetails/breakfast"
import { StepEnum } from "@/types/enums/step"
import type { StepEnum } from "@/types/enums/step"
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
import type { SafeUser } from "@/types/user"
import type { Packages } from "../requests/packages"
@@ -15,4 +15,5 @@ export interface DetailsProviderProps extends React.PropsWithChildren {
searchParamsStr: string
step: StepEnum
user: SafeUser
vat: number
}
+8 -2
View File
@@ -14,6 +14,11 @@ interface TPrice {
price: number
}
export interface RoomPrice {
perNight: Price
perStay: Price
}
export interface Price {
requested: TPrice | undefined
local: TPrice
@@ -52,14 +57,15 @@ export interface DetailsState {
isValid: Record<StepEnum, boolean>
packages: Packages | null
roomRate: DetailsProviderProps["roomRate"]
roomPrice: Price
roomPrice: RoomPrice
steps: StepEnum[]
totalPrice: Price
searchParamString: string
vat: number
}
export type InitialState = Pick<DetailsState, "booking" | "packages"> &
Pick<DetailsProviderProps, "roomRate"> & {
Pick<DetailsProviderProps, "roomRate" | "vat"> & {
bedType?: BedTypeSchema
breakfast?: false
}