fix: make sure calculations in booking flow are correct

This commit is contained in:
Simon Emanuelsson
2025-04-02 15:49:59 +02:00
committed by Michael Zetterberg
parent 3e0f503314
commit a222ecfc5c
28 changed files with 309 additions and 276 deletions
@@ -1,3 +1,4 @@
import type { RateEnum } from "@/types/enums/rate"
import type {
Product,
RoomConfiguration,
@@ -35,7 +36,7 @@ export type Rate = {
priceName?: string
priceTerm?: string
product: Product
rate: "change" | "flex" | "save"
rate: RateEnum
roomRates?: {
rate: Rate
roomIndex: number
@@ -1,5 +1,6 @@
import type { Lang } from "@/constants/languages"
import type { MembershipLevel } from "@/constants/membershipLevels"
import type { RateEnum } from "../enums/rate"
export enum TrackingChannelEnum {
"scandic-friends" = "scandic-friends",
@@ -54,7 +55,7 @@ export type TrackingSDKUserData =
export type TrackingSDKHotelInfo = {
ageOfChildren?: string // "10", "2,5,10"
ancillaries?: Ancillary[]
analyticsRateCode?: "flex" | "change" | "save" | string
analyticsRateCode?: RateEnum | string
arrivalDate?: string
availableResults?: number // Number of hotels to choose from after a city search
bedType?: string
+5
View File
@@ -0,0 +1,5 @@
export enum RateEnum {
change = "change",
flex = "flex",
save = "save",
}
@@ -1,5 +1,6 @@
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
import type { RoomRate } from "@/types/components/hotelReservation/enterDetails/details"
import type { RateEnum } from "@/types/enums/rate"
import type { Packages } from "@/types/requests/packages"
export interface Room {
@@ -10,7 +11,7 @@ export interface Room {
mustBeGuaranteed: boolean
memberMustBeGuaranteed?: boolean
packages: Packages | null
rate: "change" | "flex" | "save"
rate: RateEnum
rateDefinitionTitle: string
rateDetails: string[]
rateTitle?: string