Merged in feat/SW-1379-multiroom-summary (pull request #1198)

Feat/SW-1379 multiroom summary

* fix: added early return in hotel query and added missing type annotations

* feat(SW-1379): update summary to support multiple rooms and add tests

* fix: added check for room number when using isMember for member prices

* fix: remove mocked array

* fix: minor bug fixes in rate details popup

* fix: translation key


Approved-by: Pontus Dreij
Approved-by: Arvid Norlin
This commit is contained in:
Tobias Johansson
2025-01-29 09:25:43 +00:00
parent e29cb283db
commit a7468cd958
17 changed files with 781 additions and 382 deletions

View File

@@ -1,12 +1,11 @@
import { z } from "zod"
import { type z } from "zod"
import {
import type { breakfastFormSchema } from "@/components/HotelReservation/EnterDetails/Breakfast/schema"
import type {
breakfastPackageSchema,
breakfastPackagesSchema,
} from "@/server/routers/hotels/output"
import { breakfastFormSchema } from "@/components/HotelReservation/EnterDetails/Breakfast/schema"
export interface BreakfastFormSchema
extends z.output<typeof breakfastFormSchema> {}

View File

@@ -1,12 +1,11 @@
import { z } from "zod"
import type { z } from "zod"
import {
import type { SafeUser } from "@/types/user"
import type {
guestDetailsSchema,
signedInDetailsSchema,
} from "@/components/HotelReservation/EnterDetails/Details/schema"
import type { SafeUser } from "@/types/user"
export type DetailsSchema = z.output<typeof guestDetailsSchema>
export type SignedInDetailsSchema = z.output<typeof signedInDetailsSchema>

View File

@@ -1,7 +1,15 @@
import type { DetailsProviderProps } from "@/types/providers/enter-details"
import type { Packages } from "@/types/requests/packages"
import type { DetailsState, Price } from "@/types/stores/enter-details"
import type {
DetailsState,
Price,
RoomPrice,
} from "@/types/stores/enter-details"
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
import type { Child } from "./selectRate/selectRate"
import type { BedTypeSchema } from "./enterDetails/bedType"
import type { BreakfastPackage } from "./enterDetails/breakfast"
import type { DetailsSchema } from "./enterDetails/details"
import type { Child, SelectRateSearchParams } from "./selectRate/selectRate"
export type RoomsData = Pick<DetailsState, "roomPrice"> &
Pick<RoomAvailability, "cancellationText" | "rateDetails"> &
@@ -17,3 +25,26 @@ export interface SummaryProps
isMember: boolean
breakfastIncluded: boolean
}
export interface SummaryUIProps {
booking: SelectRateSearchParams
rooms: {
adults: number
childrenInRoom: Child[] | undefined
bedType: BedTypeSchema | undefined
breakfast: BreakfastPackage | false | undefined
guest: DetailsSchema
roomRate: DetailsProviderProps["roomRate"]
roomPrice: RoomPrice
roomType: string
rateDetails: string[] | undefined
cancellationText: string
}[]
isMember: boolean
breakfastIncluded: boolean
packages: Packages | null
totalPrice: Price
vat: number
toggleSummaryOpen: () => void
togglePriceDetailsModalOpen: () => void
}