Merged in chore/SW-3395-move-bookingconfirmationprovider (pull request #2757)

chore(SW-3395): Moved BookingConfirmationProvider to booking-flow package

* chore(SW-3395): Moved BookingConfirmationProvider to booking-flow package


Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-09-04 08:14:50 +00:00
parent 7e585b2d9a
commit 8e00769c64
19 changed files with 24 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
import type { Room } from "@/types/stores/booking-confirmation"
import type { Room } from "@scandic-hotels/booking-flow/types/stores/booking-confirmation"
export interface BookingConfirmationReceiptRoomProps {
room: Room

View File

@@ -1,5 +0,0 @@
import type { createBookingConfirmationStore } from "@/stores/booking-confirmation"
export type BookingConfirmationStore = ReturnType<
typeof createBookingConfirmationStore
>

View File

@@ -1,15 +0,0 @@
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import type { RoomCategories } from "@scandic-hotels/trpc/types/hotel"
import type { Room } from "../stores/booking-confirmation"
export interface BookingConfirmationProviderProps
extends React.PropsWithChildren {
bookingCode: string | null
currencyCode: CurrencyEnum
fromDate: string
roomCategories: RoomCategories
rooms: (Room | null)[]
toDate: string
vat: number
}

View File

@@ -1,63 +0,0 @@
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import type { ChildBedTypeEnum } from "@scandic-hotels/trpc/enums/childBedTypeEnum"
import type {
BookingConfirmation,
PackageSchema,
} from "@scandic-hotels/trpc/types/bookingConfirmation"
import type { RoomCategories } from "@scandic-hotels/trpc/types/hotel"
export interface ChildBedPreference {
quantity: number
bedType: ChildBedTypeEnum
}
export interface Room {
adults: number
bedDescription: string
bedType: string
bookingCode: string | null
breakfast: PackageSchema | false | undefined
breakfastIncluded: boolean
cheques: number
childBedPreferences: ChildBedPreference[]
childrenAges?: number[]
confirmationNumber: string
currencyCode: CurrencyEnum
fromDate: string
name: string
packages: BookingConfirmation["booking"]["packages"]
formattedRoomCost: string
rateDefinition: BookingConfirmation["booking"]["rateDefinition"]
rateCodeType: BookingConfirmation["booking"]["bookingType"]
refId: string
roomFeatures?: PackageSchema[] | null
roomPoints: number
roomPrice: number
roomTypeCode: string | null
toDate: string
totalPrice: number
totalPriceExVat: number
vatAmount: number
vouchers: number
}
export interface InitialState {
bookingCode: string | null
fromDate: string
rooms: (Room | null)[]
toDate: string
currencyCode: CurrencyEnum
roomCategories: RoomCategories
vat: number
isVatCurrency: boolean
formattedTotalCost: string
totalBookingPrice: number
totalBookingCheques: number
}
export interface BookingConfirmationState extends InitialState {
actions: {
setRoom: (room: Room, idx: number) => void
setFormattedTotalCost: (formattedTotalCost: string) => void
}
}