Merged in chore/SW-3321-move-selectratecontext-to- (pull request #2729)

chore(SW-3321): Moved Select rate context to booking-flow package

* chore(SW-3321): Moved Select rate context to booking-flow package

* chore(SW-3321): Optimised code


Approved-by: Joakim Jäderberg
This commit is contained in:
Hrishikesh Vaipurkar
2025-09-02 07:40:01 +00:00
parent 1804f7b7cd
commit 0a4bf40a15
77 changed files with 127 additions and 148 deletions

View File

@@ -1,18 +1,18 @@
import isEqual from "fast-deep-equal"
import { parsePhoneNumberFromString } from "libphonenumber-js"
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
import { logger } from "@scandic-hotels/common/logger"
import {
sumPackages,
sumPackagesRequestedPrice,
} from "@/components/HotelReservation/utils"
} from "@scandic-hotels/booking-flow/utils/SelectRate"
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
import { logger } from "@scandic-hotels/common/logger"
import { detailsStorageName } from "."
import type { BookingWidgetSearchData } from "@scandic-hotels/booking-flow/BookingWidget"
import type { SelectRateBooking } from "@scandic-hotels/booking-flow/types/components/selectRate/selectRate"
import type { Packages } from "@scandic-hotels/trpc/types/packages"
import type {
CorporateChequeProduct,
@@ -24,7 +24,6 @@ import type {
import type { BreakfastPackage } from "@/types/components/hotelReservation/breakfast"
import { type RoomRate } from "@/types/components/hotelReservation/enterDetails/details"
import type { Price } from "@/types/components/hotelReservation/price"
import type { SelectRateBooking } from "@/types/components/hotelReservation/selectRate/selectRate"
import type { PersistedState, RoomState } from "@/types/stores/enter-details"
import type { SafeUser } from "@/types/user"

View File

@@ -1,5 +1,6 @@
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import type { AvailabilityError } from "@/types/stores/rates"
import type { AvailabilityError } from "@scandic-hotels/booking-flow/types/stores/rates"
import type {
Product,
RoomConfiguration,

View File

@@ -16,11 +16,13 @@ import {
findSelectedRate,
} from "./helpers"
import type {
InitialState,
RatesState,
} from "@scandic-hotels/booking-flow/types/stores/rates"
import type { Package, Packages } from "@scandic-hotels/trpc/types/packages"
import type { PriceProduct } from "@scandic-hotels/trpc/types/roomAvailability"
import type { InitialState, RatesState } from "@/types/stores/rates"
export function createRatesStore({
booking,
hotelType,