Merge branch 'master' into feature/tracking
This commit is contained in:
@@ -4,7 +4,7 @@ import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
|
||||
export interface BookingWidgetFormProps {
|
||||
locations: Locations
|
||||
type?: BookingWidgetType
|
||||
setIsOpen: (isOpen: boolean) => void
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
export interface BookingWidgetFormContentProps {
|
||||
|
||||
5
types/components/hotelPage/sidepeek/facility.ts
Normal file
5
types/components/hotelPage/sidepeek/facility.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
|
||||
export type FacilityProps = {
|
||||
data: Hotel["healthFacilities"][number]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
|
||||
export type WellnessAndExerciseSidePeekProps = {
|
||||
healthFacilities: Hotel["healthFacilities"]
|
||||
buttonUrl?: string
|
||||
}
|
||||
@@ -25,9 +25,10 @@ type Price = {
|
||||
export type RoomsData = {
|
||||
roomType: string
|
||||
localPrice: Price
|
||||
euroPrice: Price
|
||||
euroPrice: Price | undefined
|
||||
adults: number
|
||||
children?: Child[]
|
||||
rateDetails?: string[]
|
||||
cancellationText: string
|
||||
packages: Packages | null
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export interface BreakfastPackage
|
||||
extends z.output<typeof breakfastPackageSchema> {}
|
||||
|
||||
export interface BreakfastProps {
|
||||
packages: BreakfastPackages | null
|
||||
packages: BreakfastPackages
|
||||
}
|
||||
|
||||
@@ -6,6 +6,14 @@ import type { SafeUser } from "@/types/user"
|
||||
|
||||
export type DetailsSchema = z.output<typeof guestDetailsSchema>
|
||||
|
||||
type MemberPrice = { price: number; currency: string }
|
||||
|
||||
export interface DetailsProps {
|
||||
user: SafeUser
|
||||
memberPrice?: MemberPrice
|
||||
}
|
||||
|
||||
export type JoinScandicFriendsCardProps = {
|
||||
name: string
|
||||
memberPrice?: MemberPrice
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
export enum StepEnum {
|
||||
selectBed = "select-bed",
|
||||
breakfast = "breakfast",
|
||||
details = "details",
|
||||
payment = "payment",
|
||||
}
|
||||
import { StepEnum } from "@/types/enums/step"
|
||||
|
||||
export const StepStoreKeys: Record<StepEnum, "bedType" | "breakfast" | null> = {
|
||||
"select-bed": "bedType",
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import { StepEnum } from "./step"
|
||||
|
||||
export type EnterDetailsProviderProps = { step: StepEnum; isMember: boolean }
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { RoomsData } from "./bookingData"
|
||||
|
||||
export interface SummaryProps {
|
||||
showMemberPrice: boolean
|
||||
room: RoomsData
|
||||
}
|
||||
@@ -4,7 +4,5 @@ export type AvailabilityInput = {
|
||||
roomStayEndDate: string
|
||||
adults: number
|
||||
children?: string
|
||||
promotionCode?: string
|
||||
reservationProfileType?: string
|
||||
attachedProfileId?: string
|
||||
bookingCode?: string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { CategorizedFilters } from "./hotelFilters"
|
||||
|
||||
export type FilterAndSortModalProps = {
|
||||
filters: CategorizedFilters
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export type FilterCheckboxProps = {
|
||||
name: string
|
||||
id: string
|
||||
isSelected: boolean
|
||||
onChange: (filterId: string) => void
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
|
||||
import type { ProductType } from "@/server/routers/hotels/output"
|
||||
|
||||
export type HotelPriceListProps = {
|
||||
price: HotelsAvailabilityPrices
|
||||
price: ProductType
|
||||
hotelId: string
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
|
||||
import { ProductType } from "@/server/routers/hotels/output"
|
||||
|
||||
import { Hotel } from "@/types/hotel"
|
||||
|
||||
@@ -16,5 +16,5 @@ export type HotelCardListingProps = {
|
||||
|
||||
export type HotelData = {
|
||||
hotelData: Hotel
|
||||
price: HotelsAvailabilityPrices
|
||||
price: ProductType
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ export type CategorizedFilters = {
|
||||
}
|
||||
export type HotelFiltersProps = {
|
||||
filters: CategorizedFilters
|
||||
className?: string
|
||||
}
|
||||
|
||||
export type Filter = {
|
||||
@@ -15,3 +16,7 @@ export type Filter = {
|
||||
sortOrder: number
|
||||
filter?: string
|
||||
}
|
||||
|
||||
export type HotelFilterModalProps = {
|
||||
filters: CategorizedFilters
|
||||
}
|
||||
|
||||
@@ -9,3 +9,7 @@ export type SortItem = {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export type HotelSorterProps = {
|
||||
discreet?: boolean
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from "@/server/routers/hotels/schemas/image"
|
||||
|
||||
import { HotelData } from "./hotelCardListingProps"
|
||||
import { Filter } from "./hotelFilters"
|
||||
import { CategorizedFilters, Filter } from "./hotelFilters"
|
||||
|
||||
import type { Coordinates } from "@/types/components/maps/coordinates"
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface SelectHotelMapProps {
|
||||
hotelPins: HotelPin[]
|
||||
mapId: string
|
||||
hotels: HotelData[]
|
||||
filterList: CategorizedFilters
|
||||
}
|
||||
|
||||
type ImageSizes = z.infer<typeof imageSizesSchema>
|
||||
@@ -29,8 +30,8 @@ type ImageMetaData = z.infer<typeof imageMetaDataSchema>
|
||||
export type HotelPin = {
|
||||
name: string
|
||||
coordinates: Coordinates
|
||||
publicPrice: string | null
|
||||
memberPrice: string | null
|
||||
publicPrice: number | null
|
||||
memberPrice: number | null
|
||||
currency: string | null
|
||||
images: {
|
||||
imageSizes: ImageSizes
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ProductTypePrices } from "@/server/routers/hotels/output"
|
||||
|
||||
export type PriceCardProps = {
|
||||
currency: string
|
||||
memberAmount?: string | undefined
|
||||
regularAmount?: string | undefined
|
||||
productTypePrices: ProductTypePrices
|
||||
isMemberPrice?: boolean
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { PopoverProps } from "react-aria-components"
|
||||
|
||||
export interface PricePopoverProps extends Omit<PopoverProps, "children"> {
|
||||
children: React.ReactNode
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
getRoomPackagesSchema,
|
||||
packagesSchema,
|
||||
} from "@/server/routers/hotels/output"
|
||||
import { packagesSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export enum RoomPackageCodeEnum {
|
||||
PET_ROOM = "PETR",
|
||||
ALLERGY_ROOM = "ALLG",
|
||||
ACCESSIBILITY_ROOM = "ACCE",
|
||||
}
|
||||
|
||||
export interface DefaultFilterOptions {
|
||||
code: RoomPackageCodeEnum
|
||||
description: string
|
||||
itemCode: string | undefined
|
||||
}
|
||||
export interface RoomFilterProps {
|
||||
numberOfRooms: number
|
||||
onFilter: (filter: Record<string, boolean | undefined>) => void
|
||||
filterOptions: RoomPackageData
|
||||
filterOptions: DefaultFilterOptions[]
|
||||
}
|
||||
|
||||
export type RoomPackage = z.output<typeof packagesSchema>
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface RoomSelectionProps {
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: RoomData[]
|
||||
user: SafeUser
|
||||
packages: RoomPackageData | undefined
|
||||
availablePackages: RoomPackageData | undefined
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
setRateSummary: (rateSummary: Rate) => void
|
||||
rateSummary: Rate | null
|
||||
@@ -18,5 +18,5 @@ export interface SelectRateProps {
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: RoomData[]
|
||||
user: SafeUser
|
||||
packages: RoomPackageData
|
||||
availablePackages: RoomPackageData
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface BreakfastSelectionProps extends SectionProps {
|
||||
export interface DetailsProps extends SectionProps {}
|
||||
|
||||
export interface PaymentProps {
|
||||
roomPrice: number
|
||||
roomPrice: { publicPrice: number; memberPrice: number | undefined }
|
||||
otherPaymentOptions: string[]
|
||||
savedCreditCards: CreditCard[] | null
|
||||
mustBeGuaranteed: boolean
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { StepEnum } from "../enterDetails/step"
|
||||
import { StepEnum } from "@/types/enums/step"
|
||||
|
||||
export interface SectionAccordionProps {
|
||||
header: string
|
||||
|
||||
@@ -2,14 +2,11 @@ import { poiVariants } from "@/components/Maps/Markers/Poi/variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import {
|
||||
PointOfInterestCategoryNameEnum,
|
||||
PointOfInterestGroupEnum,
|
||||
} from "@/types/hotel"
|
||||
import type { PointOfInterestGroupEnum } from "@/types/hotel"
|
||||
|
||||
export interface PoiMarkerProps extends VariantProps<typeof poiVariants> {
|
||||
group: PointOfInterestGroupEnum
|
||||
categoryName?: PointOfInterestCategoryNameEnum
|
||||
categoryName?: string
|
||||
size?: number
|
||||
className?: string
|
||||
}
|
||||
|
||||
@@ -130,3 +130,4 @@ export type TrackingPosition =
|
||||
| "hamburger menu"
|
||||
| "join scandic friends sidebar"
|
||||
| "sign up verification"
|
||||
| "enter details"
|
||||
|
||||
3
types/contexts/details.ts
Normal file
3
types/contexts/details.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createDetailsStore } from "@/stores/details"
|
||||
|
||||
export type DetailsStore = ReturnType<typeof createDetailsStore>
|
||||
3
types/contexts/steps.ts
Normal file
3
types/contexts/steps.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createStepsStore } from "@/stores/steps"
|
||||
|
||||
export type StepsStore = ReturnType<typeof createStepsStore>
|
||||
@@ -1,5 +1,4 @@
|
||||
export enum BreakfastPackageEnum {
|
||||
FREE_MEMBER_BREAKFAST = "BRF0",
|
||||
REGULAR_BREAKFAST = "BRF1",
|
||||
NO_BREAKFAST = "NO_BREAKFAST",
|
||||
}
|
||||
|
||||
6
types/enums/step.ts
Normal file
6
types/enums/step.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export enum StepEnum {
|
||||
selectBed = "select-bed",
|
||||
breakfast = "breakfast",
|
||||
details = "details",
|
||||
payment = "payment",
|
||||
}
|
||||
@@ -26,26 +26,6 @@ export type GalleryImage = z.infer<typeof imageSchema>
|
||||
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
|
||||
export enum PointOfInterestCategoryNameEnum {
|
||||
AIRPORT = "Airport",
|
||||
AMUSEMENT_PARK = "Amusement park",
|
||||
BUS_TERMINAL = "Bus terminal",
|
||||
FAIR = "Fair",
|
||||
HOSPITAL = "Hospital",
|
||||
HOTEL = "Hotel",
|
||||
MARKETING_CITY = "Marketing city",
|
||||
MUSEUM = "Museum",
|
||||
NEARBY_COMPANIES = "Nearby companies",
|
||||
PARKING_GARAGE = "Parking / Garage",
|
||||
RESTAURANT = "Restaurant",
|
||||
SHOPPING = "Shopping",
|
||||
SPORTS = "Sports",
|
||||
THEATRE = "Theatre",
|
||||
TOURIST = "Tourist",
|
||||
TRANSPORTATIONS = "Transportations",
|
||||
ZOO = "Zoo",
|
||||
}
|
||||
|
||||
export enum PointOfInterestGroupEnum {
|
||||
PUBLIC_TRANSPORT = "Public transport",
|
||||
ATTRACTIONS = "Attractions",
|
||||
|
||||
3
types/providers/details.ts
Normal file
3
types/providers/details.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface DetailsProviderProps extends React.PropsWithChildren {
|
||||
isMember: boolean
|
||||
}
|
||||
11
types/providers/steps.ts
Normal file
11
types/providers/steps.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import { StepEnum } from "@/types/enums/step"
|
||||
import type { BreakfastPackage } from "../components/hotelReservation/enterDetails/breakfast"
|
||||
|
||||
export interface StepsProviderProps extends React.PropsWithChildren {
|
||||
bedTypes: BedTypeSelection[]
|
||||
breakfastPackages: BreakfastPackage[] | null
|
||||
isMember: boolean
|
||||
searchParams: string
|
||||
step: StepEnum
|
||||
}
|
||||
40
types/stores/details.ts
Normal file
40
types/stores/details.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { BedTypeSchema } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type { BookingData } from "@/types/components/hotelReservation/enterDetails/bookingData"
|
||||
import type { BreakfastPackage } from "@/types/components/hotelReservation/enterDetails/breakfast"
|
||||
import type { DetailsSchema } from "@/types/components/hotelReservation/enterDetails/details"
|
||||
import { StepEnum } from "@/types/enums/step"
|
||||
|
||||
export interface DetailsState {
|
||||
actions: {
|
||||
setIsSubmittingDisabled: (isSubmittingDisabled: boolean) => void
|
||||
setTotalPrice: (totalPrice: TotalPrice) => void
|
||||
toggleSummaryOpen: () => void
|
||||
updateBedType: (data: BedTypeSchema) => void
|
||||
updateBreakfast: (data: BreakfastPackage | false) => void
|
||||
updateDetails: (data: DetailsSchema) => void
|
||||
updateValidity: (property: StepEnum, isValid: boolean) => void
|
||||
}
|
||||
data: DetailsSchema & {
|
||||
bedType: BedTypeSchema | undefined
|
||||
breakfast: BreakfastPackage | false | undefined
|
||||
booking: BookingData
|
||||
}
|
||||
isSubmittingDisabled: boolean
|
||||
isSummaryOpen: boolean
|
||||
isValid: Record<StepEnum, boolean>
|
||||
totalPrice: TotalPrice
|
||||
}
|
||||
|
||||
export interface InitialState extends Partial<DetailsState> {
|
||||
booking: BookingData
|
||||
}
|
||||
|
||||
interface Price {
|
||||
currency: string
|
||||
price: number
|
||||
}
|
||||
|
||||
export interface TotalPrice {
|
||||
euro: Price | undefined
|
||||
local: Price
|
||||
}
|
||||
10
types/stores/steps.ts
Normal file
10
types/stores/steps.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { StepEnum } from "@/types/enums/step"
|
||||
|
||||
export interface StepState {
|
||||
completeStep: () => void
|
||||
navigate: (step: StepEnum) => void
|
||||
setStep: (step: StepEnum) => void
|
||||
|
||||
currentStep: StepEnum
|
||||
steps: StepEnum[]
|
||||
}
|
||||
1
types/window.d.ts
vendored
1
types/window.d.ts
vendored
@@ -13,4 +13,5 @@ interface Window {
|
||||
}
|
||||
}
|
||||
Cookiebot: { changed: boolean; consented: boolean }
|
||||
ApplePaySession: (() => void) | undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user