Merge master

This commit is contained in:
Linus Flood
2024-11-28 13:37:45 +01:00
225 changed files with 4488 additions and 3192 deletions

View File

@@ -4,7 +4,7 @@ import type { CardProps } from "@/components/TempDesignSystem/Card/card"
export type FacilitiesProps = {
facilities: Facility[]
activitiesCard?: ActivityCard
activitiesCard: ActivityCard | null
}
export type FacilityImage = {

View File

@@ -0,0 +1,3 @@
export interface HotelPageProps {
hotelId: string
}

View File

@@ -1,11 +1,9 @@
import type { RoomData } from "@/types/hotel"
export interface RoomCardProps {
hotelId: string
room: RoomData
}
export type RoomsProps = {
hotelId: string
rooms: RoomData[]
}

View File

@@ -0,0 +1,5 @@
import type { RoomData } from "@/types/hotel"
export interface RoomSidePeekProps {
room: RoomData
}

View File

@@ -1,7 +1,5 @@
import { RoomPackageCodeEnum } from "../selectRate/roomFilter"
import { Child } from "../selectRate/selectRate"
import { Packages } from "@/types/requests/packages"
import type { RoomPackageCodeEnum } from "../selectRate/roomFilter"
import type { Child } from "../selectRate/selectRate"
interface Room {
adults: number
@@ -17,29 +15,3 @@ export interface BookingData {
toDate: string
rooms: Room[]
}
type Price = {
amount: number
currency: string
}
export type RoomsData = {
roomType: string
prices: {
public: {
local: Price
euro: Price | undefined
}
member:
| {
local: Price
euro: Price | undefined
}
| undefined
}
adults: number
children?: Child[]
rateDetails?: string[]
cancellationText: string
packages: Packages | null
}

View File

@@ -1,12 +1,19 @@
import { z } from "zod"
import { guestDetailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema"
import {
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>
type MemberPrice = { price: number; currency: string }
type MemberPrice = {
currency: string
price: number
}
export interface DetailsProps {
user: SafeUser

View File

@@ -0,0 +1,7 @@
import type { RouterOutput } from "@/lib/trpc/client"
type HotelDataGet = RouterOutput["hotel"]["hotelData"]["get"]
export interface HotelHeaderProps {
hotelData: NonNullable<HotelDataGet>
}

View File

@@ -0,0 +1,8 @@
export type PriceChangeDialogProps = {
isOpen: boolean
oldPrice: number
newPrice: number
currency: string
onCancel: () => void
onAccept: () => void
}

View File

@@ -1,8 +0,0 @@
import { StepEnum } from "@/types/enums/step"
export const StepStoreKeys: Record<StepEnum, "bedType" | "breakfast" | null> = {
"select-bed": "bedType",
breakfast: "breakfast",
details: null,
payment: null,
}

View File

@@ -1,6 +1,14 @@
import type { RoomsData } from "./bookingData"
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
import type { Packages } from "@/types/requests/packages"
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
export interface SummaryProps {
showMemberPrice: boolean
room: RoomsData
export interface ClientSummaryProps
extends Pick<
RoomAvailability,
"cancellationText" | "memberRate" | "rateDetails"
>,
Pick<RoomAvailability["selectedRoom"], "roomType"> {
adults: number
isMember: boolean
kids: Child[] | undefined
}

View File

@@ -1,3 +1,5 @@
import { PaymentMethodEnum } from "@/constants/booking"
import { CreditCard, SafeUser } from "@/types/user"
export interface SectionProps {
@@ -30,9 +32,14 @@ export interface DetailsProps extends SectionProps {}
export interface PaymentProps {
user: SafeUser
roomPrice: { publicPrice: number; memberPrice: number | undefined }
otherPaymentOptions: string[]
savedCreditCards: CreditCard[] | null
otherPaymentOptions: PaymentMethodEnum[]
mustBeGuaranteed: boolean
supportedCards: PaymentMethodEnum[]
}
export interface PaymentClientProps
extends Omit<PaymentProps, "supportedCards"> {
savedCreditCards: CreditCard[] | null
}
export interface SectionPageProps {

View File

@@ -0,0 +1,39 @@
import { RoomPackageCodeEnum } from "./selectRate/roomFilter"
import type { Packages } from "@/types/requests/packages"
import type { DetailsState, Price } from "@/types/stores/enter-details"
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
import type { BedTypeSchema } from "./enterDetails/bedType"
import type { BreakfastPackage } from "./enterDetails/breakfast"
import type { Child } from "./selectRate/selectRate"
export type RoomsData = Pick<DetailsState, "roomPrice"> &
Pick<RoomAvailability, "cancellationText" | "rateDetails"> &
Pick<RoomAvailability["selectedRoom"], "roomType"> & {
adults: number
children?: Child[]
packages: Packages | null
}
interface SharedSummaryProps {
fromDate: string
toDate: string
}
export interface SummaryProps extends SharedSummaryProps {
bedType: BedTypeSchema | undefined
breakfast: BreakfastPackage | false | undefined
showMemberPrice: boolean
room: RoomsData
toggleSummaryOpen?: () => void
totalPrice: Price
}
export interface SummaryPageProps extends SharedSummaryProps {
adults: number
hotelId: string
kids: Child[] | undefined
packageCodes: RoomPackageCodeEnum[] | undefined
rateCode: string
roomTypeCode: string
}

View File

@@ -1,4 +1,4 @@
export type ToggleSidePeekProps = {
hotelId: string
roomTypeCode: string
roomTypeCode?: string
}

View File

@@ -2,6 +2,7 @@ import type { Coordinates } from "./coordinates"
export type StaticMapProps = {
city?: string
country?: string
coordinates?: Coordinates
width: number
height: number