Merge branch 'master' into feature/tracking

This commit is contained in:
Linus Flood
2024-11-11 15:47:30 +01:00
253 changed files with 3837 additions and 2268 deletions

View File

@@ -1,4 +1,4 @@
export enum BedTypeEnum {
export enum ChildBedMapEnum {
IN_ADULTS_BED = 0,
IN_CRIB = 1,
IN_EXTRA_BED = 2,

View File

@@ -21,6 +21,7 @@ export enum ActionType {
CLEAR_SEARCH_LOCATIONS = "CLEAR_SEARCH_LOCATIONS",
SEARCH_LOCATIONS = "SEARCH_LOCATIONS",
SELECT_ITEM = "SELECT_ITEM",
SET_STORAGE_DATA = "SET_STORAGE_DATA",
}
interface ClearHistoryLocationsAction {
@@ -46,11 +47,20 @@ interface SetItemAction {
type: ActionType.SELECT_ITEM
}
interface SetStorageData {
payload: {
searchData: Location
searchHistory: Locations
}
type: ActionType.SET_STORAGE_DATA
}
export type Action =
| ClearHistoryLocationsAction
| ClearSearchLocationsAction
| SearchLocationsAction
| SetItemAction
| SetStorageData
export interface State {
defaultLocations: Locations

View File

@@ -1,13 +1,19 @@
import { ReactElement } from "react"
import { HotelData } from "../../hotelReservation/selectHotel/hotelCardListingProps"
import { HotelPin } from "../../hotelReservation/selectHotel/map"
import type { Coordinates } from "@/types/components/maps/coordinates"
import type { PointOfInterest } from "@/types/hotel"
export interface InteractiveMapProps {
coordinates: Coordinates
pointsOfInterest: PointOfInterest[]
activePoi: PointOfInterest["name"] | null
pointsOfInterest?: PointOfInterest[]
activePoi?: PointOfInterest["name"] | null
hotelPins?: HotelPin[]
activeHotelPin?: HotelPin["name"] | null
mapId: string
onActivePoiChange: (poi: PointOfInterest["name"] | null) => void
closeButton: ReactElement
onActivePoiChange?: (poi: PointOfInterest["name"] | null) => void
onActiveHotelPinChange?: (hotelPin: HotelPin["name"] | null) => void
}

View File

@@ -1,40 +1,3 @@
export type BookingConfirmation = {
email: string
hotel: {
name: string
address: string
location: string
phone: string
image: string
checkIn: string
checkOut: string
breakfast: {
start: string
end: string
}
}
stay: {
nights: number
start: string
end: string
}
summary: {
roomType: string
bedType: string
breakfast: string
flexibility: string
}
}
export type IntroSectionProps = {
email: BookingConfirmation["email"]
}
export type StaySectionProps = {
hotel: BookingConfirmation["hotel"]
stay: BookingConfirmation["stay"]
}
export type SummarySectionProps = {
summary: BookingConfirmation["summary"]
export interface BookingConfirmationProps {
confirmationNumber: string
}

View File

@@ -1,8 +1,11 @@
import { z } from "zod"
import { bedTypeSchema } from "@/components/HotelReservation/EnterDetails/BedType/schema"
import {
bedTypeFormSchema,
bedTypeSchema,
} from "@/components/HotelReservation/EnterDetails/BedType/schema"
export type BedType = {
export type BedTypeSelection = {
description: string
size: {
min: number
@@ -11,7 +14,9 @@ export type BedType = {
value: string
}
export type BedTypeProps = {
bedTypes: BedType[]
bedTypes: BedTypeSelection[]
}
export interface BedTypeSchema extends z.output<typeof bedTypeSchema> {}
export interface BedTypeFormSchema extends z.output<typeof bedTypeFormSchema> {}
export type BedTypeSchema = z.output<typeof bedTypeSchema>["bedType"]

View File

@@ -1,21 +1,18 @@
import { BedTypeEnum } from "../../bookingWidget/enums"
interface Child {
bed: BedTypeEnum
age: number
}
import { RoomPackageCodeEnum } from "../selectRate/roomFilter"
import { Child } from "../selectRate/selectRate"
interface Room {
adults: number
roomtype?: string
ratecode?: string
child?: Child[]
roomTypeCode: string
rateCode: string
children?: Child[]
packages?: RoomPackageCodeEnum[]
}
export interface BookingData {
hotel: string
fromDate: string
toDate: string
room: Room[]
rooms: Room[]
}
type Price = {

View File

@@ -2,8 +2,16 @@ import { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
import { Hotel } from "@/types/hotel"
export enum HotelCardListingTypeEnum {
MapListing = "mapListing",
PageListing = "pageListing",
}
export type HotelCardListingProps = {
hotelData: HotelData[]
type?: HotelCardListingTypeEnum
activeCard?: string | null
onHotelCardHover?: (hotelName: string | null) => void
}
export type HotelData = {

View File

@@ -1,5 +1,11 @@
import { HotelData } from "./hotelCardListingProps"
import {
HotelCardListingTypeEnum,
type HotelData,
} from "./hotelCardListingProps"
export type HotelCardProps = {
hotel: HotelData
type?: HotelCardListingTypeEnum
state?: "default" | "active"
onHotelCardHover?: (hotelName: string | null) => void
}

View File

@@ -1,7 +1,11 @@
import { Hotel } from "@/types/hotel"
export type CategorizedFilters = {
facilityFilters: Hotel["detailedFacilities"]
surroundingsFilters: Hotel["detailedFacilities"]
}
export type HotelFiltersProps = {
filters: Hotel["detailedFacilities"]
filters: CategorizedFilters
}
export type Filter = {

View File

@@ -0,0 +1,11 @@
export const enum SortOrder {
Distance = "distance",
Name = "name",
Price = "price",
TripAdvisorRating = "tripadvisor",
}
export type SortItem = {
label: string
value: string
}

View File

@@ -1,16 +1,55 @@
import { Coordinates } from "@/types/components/maps/coordinates"
import type { PointOfInterest } from "@/types/hotel"
import { z } from "zod"
import {
imageMetaDataSchema,
imageSizesSchema,
} from "@/server/routers/hotels/schemas/image"
import { HotelData } from "./hotelCardListingProps"
import { Filter } from "./hotelFilters"
import type { Coordinates } from "@/types/components/maps/coordinates"
export interface HotelListingProps {
// pointsOfInterest: PointOfInterest[]
// activePoi: PointOfInterest["name"] | null
// onActivePoiChange: (poi: PointOfInterest["name"] | null) => void
hotels: HotelData[]
activeHotelPin?: string | null
onHotelCardHover?: (hotelName: string | null) => void
}
export interface SelectHotelMapProps {
apiKey: string
coordinates: Coordinates
pointsOfInterest: PointOfInterest[]
hotelPins: HotelPin[]
mapId: string
isModal: boolean
hotels: HotelData[]
}
type ImageSizes = z.infer<typeof imageSizesSchema>
type ImageMetaData = z.infer<typeof imageMetaDataSchema>
export type HotelPin = {
name: string
coordinates: Coordinates
publicPrice: string | null
memberPrice: string | null
currency: string | null
images: {
imageSizes: ImageSizes
metaData: ImageMetaData
}[]
amenities: Filter[]
ratings: number | null
}
export interface HotelListingMapContentProps {
activeHotelPin?: HotelPin["name"] | null
hotelPins: HotelPin[]
onActiveHotelPinChange?: (pinName: string | null) => void
}
export interface HotelCardDialogProps {
isOpen: boolean
pin: HotelPin
handleClose: (event: { stopPropagation: () => void }) => void
}

View File

@@ -28,7 +28,7 @@ export interface BreakfastSelectionProps extends SectionProps {
export interface DetailsProps extends SectionProps {}
export interface PaymentProps {
hotelId: string
roomPrice: string
otherPaymentOptions: string[]
savedCreditCards: CreditCard[] | null
mustBeGuaranteed: boolean

View File

@@ -1,9 +1,9 @@
import { Product, RoomConfiguration } from "@/server/routers/hotels/output"
import { BedTypeEnum } from "../../bookingWidget/enums"
import { ChildBedMapEnum } from "../../bookingWidget/enums"
export interface Child {
bed: BedTypeEnum
bed: ChildBedMapEnum
age: number
}
@@ -13,6 +13,7 @@ interface Room {
ratecode: string
counterratecode?: string
child?: Child[]
packages?: string
}
export interface SelectRateSearchParams {

View File

@@ -22,9 +22,13 @@ export enum IconName {
Check = "Check",
CheckCircle = "CheckCircle",
ChevronDown = "ChevronDown",
ChevronDownSmall = "ChevronDownSmall",
ChevronLeft = "ChevronLeft",
ChevronLeftSmall = "ChevronLeftSmall",
ChevronRight = "ChevronRight",
ChevronRightSmall = "ChevronRightSmall",
ChevronUp = "ChevronUp",
ChevronUpSmall = "ChevronUpSmall",
Close = "Close",
CloseLarge = "CloseLarge",
CoffeeAlt = "CoffeeAlt",