Merged in feat(SW-2083)-missing-booking-codes-scenarios-my-stay (pull request #1680)

Feat(SW-2083) missing booking codes scenarios my stay

* feat(SW-2083) Show points instead of reward nights

* feat(SW-2083) added support for cheque and voucher for totalPrice


Approved-by: Niclas Edenvin
This commit is contained in:
Pontus Dreij
2025-03-31 11:42:47 +00:00
parent 7434f30c20
commit b48053b8b4
23 changed files with 240 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ import { create } from "zustand"
import type { BreakfastPackage } from "@/types/components/hotelReservation/breakfast"
import type { BedTypeSchema } from "@/types/components/hotelReservation/enterDetails/bedType"
import type { RoomPrice } from "@/types/components/hotelReservation/enterDetails/details"
import type { PriceType } from "@/types/components/hotelReservation/myStay/myStay"
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
import type { Packages } from "@/types/requests/packages"
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
@@ -21,6 +22,8 @@ export type Room = Pick<
| "confirmationNumber"
| "cancellationNumber"
| "bookingCode"
| "cheques"
| "vouchers"
| "isCancelable"
| "multiRoom"
| "canChangeDate"
@@ -28,6 +31,7 @@ export type Room = Pick<
| "roomTypeCode"
| "currencyCode"
| "vatPercentage"
| "roomPoints"
> & {
roomName: string
roomNumber: number | null
@@ -41,6 +45,7 @@ export type Room = Pick<
breakfast: BreakfastPackage | false
mainRoom: boolean
isPrePaid: boolean
priceType: PriceType
}
interface MyStayRoomDetailsState {
@@ -66,6 +71,8 @@ export const useMyStayRoomDetailsStore = create<MyStayRoomDetailsState>(
confirmationNumber: "",
cancellationNumber: null,
bookingCode: null,
cheques: 0,
vouchers: 0,
currencyCode: "",
guest: {
email: "",
@@ -85,6 +92,7 @@ export const useMyStayRoomDetailsStore = create<MyStayRoomDetailsState>(
rateCode: "",
title: null,
},
roomPoints: 0,
roomPrice: {
perNight: {
requested: {
@@ -129,6 +137,7 @@ export const useMyStayRoomDetailsStore = create<MyStayRoomDetailsState>(
linkedReservations: [],
isCancelable: false,
isPrePaid: false,
priceType: "money",
},
linkedReservationRooms: [],
actions: {