Merge branch 'develop'

This commit is contained in:
Linus Flood
2024-11-07 10:20:12 +01:00
261 changed files with 5132 additions and 2106 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { CardsGrid } from "@/types/trpc/routers/contentstack/blocks"
import type { CardsGrid } from "@/types/trpc/routers/contentstack/blocks"
export interface CardsGridProps extends Pick<CardsGrid, "cards_grid"> {
firstItem?: boolean
+6 -1
View File
@@ -1,8 +1,13 @@
import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstack/accountPage"
import type { Block as CollectionPageBlock } from "@/types/trpc/routers/contentstack/collectionPage"
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
export type Blocks = AccountPageBlock | ContentPageBlock | LoyaltyPageBlock
export type Blocks =
| AccountPageBlock
| CollectionPageBlock
| ContentPageBlock
| LoyaltyPageBlock
export interface BlocksProps {
blocks: Blocks[]
-11
View File
@@ -1,11 +0,0 @@
import { z } from "zod"
import { detailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema"
import type { SafeUser } from "@/types/user"
export type DetailsSchema = z.output<typeof detailsSchema>
export interface DetailsProps {
user: SafeUser
}
-6
View File
@@ -1,6 +0,0 @@
export enum StepEnum {
selectBed = "select-bed",
breakfast = "breakfast",
details = "details",
payment = "payment",
}
-1
View File
@@ -14,7 +14,6 @@ export interface BookingWidgetFormProps {
export interface BookingWidgetFormContentProps {
locations: Locations
formId: string
formState: FormState<BookingWidgetSchema>
}
export enum ActionType {
@@ -0,0 +1,8 @@
import type { Coordinates } from "@/types/components/maps/coordinates"
import type { PointOfInterest } from "@/types/hotel"
export interface MapWithCardWrapperProps {
coordinates: Coordinates
hotelName: string
topThreePois: PointOfInterest[]
}
+3 -5
View File
@@ -1,13 +1,11 @@
import type { RoomData } from "@/types/hotel"
export interface RoomCardProps {
id: string
images: RoomData["images"]
title: string
subtitle: string
badgeTextTransKey: string | null
hotelId: string
room: RoomData
}
export type RoomsProps = {
hotelId: string
rooms: RoomData[]
}
@@ -2,4 +2,16 @@ import { z } from "zod"
import { bedTypeSchema } from "@/components/HotelReservation/EnterDetails/BedType/schema"
export type BedType = {
description: string
size: {
min: number
max: number
}
value: string
}
export type BedTypeProps = {
bedTypes: BedType[]
}
export interface BedTypeSchema extends z.output<typeof bedTypeSchema> {}
@@ -0,0 +1,33 @@
import { BedTypeEnum } from "../../bookingWidget/enums"
interface Child {
bed: BedTypeEnum
age: number
}
interface Room {
adults: number
roomtype?: string
ratecode?: string
child?: Child[]
}
export interface BookingData {
hotel: string
fromDate: string
toDate: string
room: Room[]
}
type Price = {
price?: string
currency?: string
}
export type RoomsData = {
roomType: string
localPrice: Price
euroPrice: Price
adults: number
children?: Child[]
cancellationText: string
}
@@ -0,0 +1,11 @@
import { z } from "zod"
import { guestDetailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema"
import type { SafeUser } from "@/types/user"
export type DetailsSchema = z.output<typeof guestDetailsSchema>
export interface DetailsProps {
user: SafeUser
}
@@ -0,0 +1,13 @@
export enum StepEnum {
selectBed = "select-bed",
breakfast = "breakfast",
details = "details",
payment = "payment",
}
export const StepStoreKeys: Record<StepEnum, "bedType" | "breakfast" | null> = {
"select-bed": "bedType",
breakfast: "breakfast",
details: null,
payment: null,
}
@@ -0,0 +1,3 @@
import { StepEnum } from "./step"
export type EnterDetailsProviderProps = { step: StepEnum; isMember: boolean }
@@ -0,0 +1,8 @@
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
import { Hotel } from "@/types/hotel"
export type HotelSidePeekProps = {
hotel: Hotel
activeSidePeek: SidePeekEnum
close: () => void
}
@@ -12,4 +12,5 @@ export interface SelectHotelMapProps {
coordinates: Coordinates
pointsOfInterest: PointOfInterest[]
mapId: string
isModal: boolean
}
@@ -5,12 +5,6 @@ export enum AvailabilityEnum {
NotAvailable = "NotAvailable",
}
export interface DetailedAmenity {
name: string
heading: string
description: string
}
export interface ReadMoreProps {
label: string
hotelId: string
@@ -1,14 +1,17 @@
import { z } from "zod"
import {
priceSchema,
Product,
productTypePriceSchema,
RoomConfiguration,
} from "@/server/routers/hotels/output"
import { RoomPackage } from "./roomFilter"
import { Rate } from "./selectRate"
type ProductPrice = z.output<typeof productTypePriceSchema>
export type RoomPriceSchema = z.output<typeof priceSchema>
export type FlexibilityOptionProps = {
product: Product | undefined
@@ -19,10 +22,12 @@ export type FlexibilityOptionProps = {
roomType: RoomConfiguration["roomType"]
roomTypeCode: RoomConfiguration["roomTypeCode"]
features: RoomConfiguration["features"]
petRoomPackage: RoomPackage | undefined
handleSelectRate: (rate: Rate) => void
}
export interface PriceListProps {
publicPrice?: ProductPrice | Record<string, never>
memberPrice?: ProductPrice | Record<string, never>
petRoomPackage?: RoomPackage | undefined
}
@@ -1,15 +1,35 @@
import { z } from "zod"
import {
RateDefinition,
RoomConfiguration,
} from "@/server/routers/hotels/output"
import { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
import { RoomPriceSchema } from "./flexibilityOption"
import { Rate } from "./selectRate"
import { RoomData } from "@/types/hotel"
import type { RoomData } from "@/types/hotel"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
export type RoomCardProps = {
hotelId: string
roomConfiguration: RoomConfiguration
rateDefinitions: RateDefinition[]
roomCategories: RoomData[]
selectedPackages: RoomPackageCodes[]
packages: RoomPackageData
handleSelectRate: (rate: Rate) => void
}
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
export type CalculatePricesPerNightProps = {
publicLocalPrice: RoomPriceSchema
memberLocalPrice: RoomPriceSchema
publicRequestedPrice?: RoomPriceSchema
memberRequestedPrice?: RoomPriceSchema
petRoomLocalPrice?: RoomPackagePriceSchema
petRoomRequestedPrice?: RoomPackagePriceSchema
nights: number
}
@@ -1,6 +1,9 @@
import { z } from "zod"
import { getRoomPackagesSchema } from "@/server/routers/hotels/schemas/packages"
import {
getRoomPackagesSchema,
packagesSchema,
} from "@/server/routers/hotels/schemas/packages"
export enum RoomPackageCodeEnum {
PET_ROOM = "PETR",
@@ -17,3 +20,5 @@ export interface RoomPackageData
extends z.output<typeof getRoomPackagesSchema> {}
export type RoomPackageCodes = RoomPackageData[number]["code"]
export type RoomPackage = z.output<typeof packagesSchema>
@@ -1,11 +1,12 @@
import type { RoomData } from "@/types/hotel"
import type { SafeUser } from "@/types/user"
import type { RoomsAvailability } from "@/server/routers/hotels/output"
import type { RoomPackageData } from "./roomFilter"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
export interface RoomSelectionProps {
roomsAvailability: RoomsAvailability
roomCategories: RoomData[]
user: SafeUser
packages: RoomPackageData
selectedPackages: RoomPackageCodes[]
}
@@ -1,8 +0,0 @@
import { RoomConfiguration } from "@/server/routers/hotels/output"
import { RoomData } from "@/types/hotel"
export type RoomSidePeekProps = {
roomConfiguration: RoomConfiguration
selectedRoom?: RoomData
}
@@ -1,4 +1,4 @@
import { StepEnum } from "../../enterDetails/step"
import { StepEnum } from "../enterDetails/step"
export interface SectionAccordionProps {
header: string
@@ -1,14 +1,17 @@
import { Product, RoomConfiguration } from "@/server/routers/hotels/output"
import { BedTypeEnum } from "../../bookingWidget/enums"
export interface Child {
bed: string
bed: BedTypeEnum
age: number
}
interface Room {
adults: number
roomcode?: string
ratecode?: string
roomtype: string
ratecode: string
counterratecode?: string
child?: Child[]
}
@@ -2,6 +2,7 @@ import { Hotel } from "@/types/hotel"
export enum SidePeekEnum {
hotelDetails = "hotel-detail-side-peek",
roomDetails = "room-detail-side-peek",
}
export type SidePeekProps = {
@@ -0,0 +1,4 @@
export type ToggleSidePeekProps = {
hotelId: string
roomTypeCode: string
}
@@ -0,0 +1,9 @@
import { SidePeekEnum } from "../hotelReservation/sidePeek"
import type { RoomData } from "@/types/hotel"
export type RoomSidePeekProps = {
room: RoomData
activeSidePeek: SidePeekEnum | null
close: () => void
}
+1
View File
@@ -6,6 +6,7 @@ export enum TrackingChannelEnum {
"scandic-friends" = "scandic-friends",
"static-content-page" = "static-content-page",
"hotelreservation" = "hotelreservation",
"collection-page" = "collection-page",
}
export type TrackingChannel = keyof typeof TrackingChannelEnum