fix: always use totalPrice to display roomCharge

This commit is contained in:
Simon Emanuelsson
2025-04-16 12:41:37 +02:00
parent 1f94c581ae
commit 722d4505ba
18 changed files with 312 additions and 864 deletions

View File

@@ -3,7 +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 { PriceTypeEnum } from "@/types/components/hotelReservation/myStay/myStay"
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
import { CurrencyEnum } from "@/types/enums/currency"
import type { Packages } from "@/types/requests/packages"
@@ -33,6 +33,9 @@ export type Room = Pick<
| "currencyCode"
| "vatPercentage"
| "roomPoints"
| "totalPrice"
| "totalPriceExVat"
| "vatAmount"
> & {
roomName: string
roomNumber: number | null
@@ -45,7 +48,7 @@ export type Room = Pick<
roomPrice: RoomPrice
breakfast: BreakfastPackage | null
mainRoom: boolean
priceType: PriceType
priceType: PriceTypeEnum
}
interface MyStayRoomDetailsState {
@@ -118,6 +121,7 @@ export const useMyStayRoomDetailsStore = create<MyStayRoomDetailsState>(
vatPercentage: 0,
vatAmount: 0,
totalPriceExVat: 0,
totalPrice: 0,
createDateTime: new Date(),
canChangeDate: false,
multiRoom: false,
@@ -136,7 +140,7 @@ export const useMyStayRoomDetailsStore = create<MyStayRoomDetailsState>(
breakfast: null,
linkedReservations: [],
isCancelable: false,
priceType: "money",
priceType: PriceTypeEnum.money,
},
linkedReservationRooms: [],
actions: {