Feat/SW-1379 multiroom summary * fix: added early return in hotel query and added missing type annotations * feat(SW-1379): update summary to support multiple rooms and add tests * fix: added check for room number when using isMember for member prices * fix: remove mocked array * fix: minor bug fixes in rate details popup * fix: translation key Approved-by: Pontus Dreij Approved-by: Arvid Norlin
139 lines
3.2 KiB
TypeScript
139 lines
3.2 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,
|
|
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 { PackageTypeEnum } from "@/types/enums/packages"
|
|
import type { RoomPrice, RoomRate } from "@/types/stores/enter-details"
|
|
|
|
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],
|
|
},
|
|
],
|
|
}
|
|
|
|
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: "SEK",
|
|
},
|
|
requestedPrice: {
|
|
pricePerNight: 132,
|
|
pricePerStay: 132,
|
|
currency: "EUR",
|
|
},
|
|
},
|
|
publicRate: {
|
|
rateCode: "SAVEEU",
|
|
localPrice: {
|
|
pricePerNight: 1525,
|
|
pricePerStay: 1525,
|
|
currency: "SEK",
|
|
},
|
|
requestedPrice: {
|
|
pricePerNight: 133,
|
|
pricePerStay: 133,
|
|
currency: "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",
|
|
}
|