Files
web/__mocks__/hotelReservation/index.ts
Tobias Johansson b394d54c3f Merged in feat/enter-details-multiroom (pull request #1280)
feat(SW-1259): Enter details multiroom

* refactor: remove per-step URLs

* WIP: map multiroom data

* fix: lint errors in details page

* fix: made useEnterDetailsStore tests pass

* fix: WIP refactor enter details store

* fix: WIP enter details store update

* fix: added room index to select correct room

* fix: added logic for navigating between steps and rooms

* fix: update summary to work with store changes

* fix: added room and total price calculation

* fix: removed unused code and added test for breakfast included

* refactor: move store selectors into helpers

* refactor: session storage state for multiroom booking

* feat: update enter details accordion navigation

* fix: added room index to each form component so they select correct room

* fix: added unique id to input to handle case when multiple inputs have same name

* fix: update payment step with store changes

* fix: rebase issues

* fix: now you should only be able to go to a step if previous room is completed

* refactor: cleanup

* fix: if no availability just skip that room for now

* fix: add select-rate Summary and adjust typings


Approved-by: Arvid Norlin
2025-02-11 14:24:24 +00:00

149 lines
3.4 KiB
TypeScript

import { BedTypeEnum } from "@/constants/booking"
import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums"
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
import type { BreakfastPackage } from "@/types/components/hotelReservation/enterDetails/breakfast"
import type {
DetailsSchema,
RoomPrice,
RoomRate,
SignedInDetailsSchema,
} from "@/types/components/hotelReservation/enterDetails/details"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
import { CurrencyEnum } from "@/types/enums/currency"
import { PackageTypeEnum } from "@/types/enums/packages"
export const booking: SelectRateSearchParams = {
city: "Stockholm",
hotelId: "811",
fromDate: "2030-01-01",
toDate: "2030-01-03",
rooms: [
{
adults: 2,
roomTypeCode: "",
rateCode: "",
counterRateCode: "",
childrenInRoom: [{ bed: ChildBedMapEnum.IN_EXTRA_BED, age: 5 }],
packages: [RoomPackageCodeEnum.PET_ROOM],
},
{
adults: 2,
roomTypeCode: "",
rateCode: "",
counterRateCode: "",
childrenInRoom: [{ bed: ChildBedMapEnum.IN_EXTRA_BED, age: 5 }],
packages: [RoomPackageCodeEnum.PET_ROOM],
},
],
}
export const breakfastPackage: BreakfastPackage = {
code: "BRF1",
description: "Breakfast with reservation",
localPrice: { currency: "SEK", price: "99", totalPrice: "99" },
requestedPrice: {
currency: "EUR",
price: "9",
totalPrice: "9",
},
packageType: PackageTypeEnum.BreakfastAdult as const,
}
export const roomRate: RoomRate = {
memberRate: {
rateCode: "PLSA2BEU",
localPrice: {
pricePerNight: 1508,
pricePerStay: 1508,
currency: CurrencyEnum.SEK,
},
requestedPrice: {
pricePerNight: 132,
pricePerStay: 132,
currency: CurrencyEnum.EUR,
},
},
publicRate: {
rateCode: "SAVEEU",
localPrice: {
pricePerNight: 1525,
pricePerStay: 1525,
currency: CurrencyEnum.SEK,
},
requestedPrice: {
pricePerNight: 133,
pricePerStay: 133,
currency: CurrencyEnum.EUR,
},
},
}
export const roomPrice: RoomPrice = {
perNight: {
local: {
currency: "SEK",
price: 1525,
},
requested: {
currency: "EUR",
price: 133,
},
},
perStay: {
local: {
currency: "SEK",
price: 1525,
},
requested: {
currency: "EUR",
price: 133,
},
},
}
export const bedType: { [x: string]: BedTypeSelection } = {
king: {
type: BedTypeEnum.King,
description: "King-size bed",
value: "SKS",
size: {
min: 180,
max: 200,
},
extraBed: undefined,
},
queen: {
type: BedTypeEnum.Queen,
description: "Queen-size bed",
value: "QZ",
size: {
min: 160,
max: 200,
},
extraBed: undefined,
},
}
export const guestDetailsNonMember: DetailsSchema = {
join: false,
countryCode: "SE",
email: "tester@testersson.com",
firstName: "Test",
lastName: "Testersson",
phoneNumber: "72727272",
}
export const guestDetailsMember: SignedInDetailsSchema = {
join: false,
countryCode: "SE",
email: "tester@testersson.com",
firstName: "Test",
lastName: "Testersson",
phoneNumber: "72727272",
zipCode: "12345",
dateOfBirth: "1999-01-01",
membershipNo: "12421412211212",
}