Merged in feat/sw-2857-refactor-booking-flow-url-updates (pull request #2302)
feat(SW-2857): Refactor booking flow url updates * Add support for removing parameters when using initial values in serializeSearchParams * Don't manually write search params in rate store * Booking is already from live search params so no need * Fix input type in serializeBookingSearchParams Approved-by: Linus Flood
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import type { Child, Room } from "../hotelReservation/selectRate/selectRate"
|
||||
import type { Child } from "../hotelReservation/selectRate/selectRate"
|
||||
|
||||
export type ChildBed = {
|
||||
label: string
|
||||
value: number
|
||||
}
|
||||
|
||||
export type GuestsRoom = Required<Pick<Room, "adults" | "childrenInRoom">>
|
||||
export type GuestsRoom = {
|
||||
adults: number
|
||||
childrenInRoom: Child[]
|
||||
}
|
||||
|
||||
export type GuestsRoomPickerProps = {
|
||||
index: number
|
||||
|
||||
@@ -14,12 +14,12 @@ export interface Child {
|
||||
|
||||
export interface Room {
|
||||
adults: number
|
||||
bookingCode?: string
|
||||
childrenInRoom?: Child[]
|
||||
counterRateCode?: string
|
||||
packages?: PackageEnum[]
|
||||
rateCode?: string
|
||||
roomTypeCode?: string
|
||||
bookingCode?: string | null
|
||||
counterRateCode?: string | null
|
||||
packages?: PackageEnum[] | null
|
||||
rateCode?: string | null
|
||||
roomTypeCode?: string | null
|
||||
}
|
||||
|
||||
export type SelectRateBooking = {
|
||||
|
||||
@@ -27,7 +27,6 @@ interface Actions {
|
||||
modifyRate: () => void
|
||||
removeSelectedPackage: (code: PackageEnum) => void
|
||||
removeSelectedPackages: () => void
|
||||
removeSelectedRoom: () => void
|
||||
selectFilter: (filter: BookingCodeFilterEnum) => void
|
||||
selectPackages: (codes: PackageEnum[]) => void
|
||||
selectRate: (rate: SelectedRate, isUserLoggedIn: boolean) => void
|
||||
@@ -58,14 +57,12 @@ export interface RatesState {
|
||||
hotelType: string | undefined
|
||||
isRedemptionBooking: boolean
|
||||
packageOptions: DefaultFilterOptions[]
|
||||
pathname: string
|
||||
rateSummary: Array<Rate | null>
|
||||
rooms: SelectedRoom[]
|
||||
roomCategories: Room[]
|
||||
roomConfigurations: RoomConfiguration[][]
|
||||
roomsPackages: Package[][]
|
||||
roomsAvailability: (RoomsAvailability | AvailabilityError)[] | undefined
|
||||
searchParams: URLSearchParams
|
||||
vat: number
|
||||
defaultCurrency: CurrencyEnum
|
||||
}
|
||||
@@ -73,14 +70,10 @@ export interface RatesState {
|
||||
export interface InitialState
|
||||
extends Pick<
|
||||
RatesState,
|
||||
| "booking"
|
||||
| "hotelType"
|
||||
| "pathname"
|
||||
| "roomCategories"
|
||||
| "roomsAvailability"
|
||||
| "searchParams"
|
||||
| "vat"
|
||||
"booking" | "hotelType" | "roomCategories" | "roomsAvailability" | "vat"
|
||||
> {
|
||||
initialActiveRoom?: number
|
||||
pathname: string
|
||||
labels: {
|
||||
accessibilityRoom: string
|
||||
allergyRoom: string
|
||||
|
||||
Reference in New Issue
Block a user