diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx
index 3b032bb36..f949f3de3 100644
--- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx
+++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx
@@ -6,7 +6,7 @@ import {
getBreakfastPackages,
getHotel,
getProfileSafely,
- getSelectedRoomsAvailability,
+ getSelectedRoomsAvailabilityEnterDetails,
} from "@/lib/trpc/memoizedRequests"
import HotelHeader from "@/components/HotelReservation/EnterDetails/Header"
@@ -61,7 +61,7 @@ export default async function DetailsPage({
void getBreakfastPackages(breakfastInput)
void getProfileSafely()
- const roomsAvailability = await getSelectedRoomsAvailability({
+ const roomsAvailability = await getSelectedRoomsAvailabilityEnterDetails({
booking,
lang,
})
diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/Actions/ModifyStay/hooks/useModifyStay.ts b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/Actions/ModifyStay/hooks/useModifyStay.ts
index 826fc0622..969c65b0a 100644
--- a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/Actions/ModifyStay/hooks/useModifyStay.ts
+++ b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/Actions/ModifyStay/hooks/useModifyStay.ts
@@ -79,6 +79,7 @@ export default function useModifyStay({
const data = await utils.hotel.availability.myStay.fetch({
booking: {
fromDate: formValues.checkInDate,
+ toDate: formValues.checkOutDate,
hotelId: bookedRoom.hotelId,
room: {
adults: bookedRoom.adults,
@@ -87,7 +88,6 @@ export default function useModifyStay({
rateCode: bookedRoom.rateDefinition.rateCode,
roomTypeCode: bookedRoom.roomTypeCode,
},
- toDate: formValues.checkOutDate,
},
lang,
})
diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx
index 8a4108cf7..d4294b066 100644
--- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx
@@ -21,7 +21,6 @@ import { getTotalPrice } from "./utils"
import styles from "./rateSummary.module.css"
import type { RateSummaryProps } from "@/types/components/hotelReservation/selectRate/rateSummary"
-import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { RateEnum } from "@/types/enums/rate"
import { RateTypeEnum } from "@/types/enums/rateType"
@@ -265,15 +264,12 @@ export default function RateSummary({ isUserLoggedIn }: RateSummaryProps) {
return total
}
- const hasSelectedPetRoom = roomPackages.find(
- (pkg) => pkg.code === RoomPackageCodeEnum.PET_ROOM
- )
- if (!hasSelectedPetRoom) {
- return total + price
- }
- return (
- total + price + hasSelectedPetRoom.localPrice.totalPrice
+ const selectedPackagesPrice = roomPackages.reduce(
+ (acc, pkg) => acc + pkg.localPrice.totalPrice,
+ 0
)
+
+ return total + price + selectedPackagesPrice
}, 0),
currency: mainRoomCurrency,
}}
diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx
index 5bbac88a1..325f9920d 100644
--- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx
@@ -16,7 +16,6 @@ import { useRoomContext } from "@/contexts/SelectRate/Room"
import styles from "./selectedRoomPanel.module.css"
-import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { CurrencyEnum } from "@/types/enums/currency"
import { RateEnum } from "@/types/enums/rate"
@@ -70,13 +69,11 @@ export default function SelectedRoomPanel() {
return null
}
- let petRoomPrice = 0
- const petRoomPackageSelected = selectedPackages.find(
- (pkg) => pkg.code === RoomPackageCodeEnum.PET_ROOM
+ const selectedPackagesPrice = selectedPackages.reduce(
+ (total, pkg) => total + pkg.localPrice.totalPrice,
+ 0
)
- if (petRoomPackageSelected) {
- petRoomPrice = petRoomPackageSelected.localPrice.totalPrice / nights
- }
+ const selectedPackagesPricePerNight = selectedPackagesPrice / nights
const night = intl.formatMessage({ id: "night" })
let selectedProduct
@@ -87,10 +84,10 @@ export default function SelectedRoomPanel() {
selectedRate.product.member
) {
const { localPrice } = selectedRate.product.member
- selectedProduct = `${localPrice.pricePerNight + petRoomPrice} ${localPrice.currency} / ${night}`
+ selectedProduct = `${localPrice.pricePerNight + selectedPackagesPricePerNight} ${localPrice.currency} / ${night}`
} else if ("public" in selectedRate.product && selectedRate.product.public) {
const { localPrice } = selectedRate.product.public
- selectedProduct = `${localPrice.pricePerNight + petRoomPrice} ${localPrice.currency} / ${night}`
+ selectedProduct = `${localPrice.pricePerNight + selectedPackagesPricePerNight} ${localPrice.currency} / ${night}`
} else if ("corporateCheque" in selectedRate.product) {
const { localPrice } = selectedRate.product.corporateCheque
selectedProduct = `${localPrice.numberOfCheques} ${CurrencyEnum.CC}`
diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/BookingCodeFilter/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/BookingCodeFilter/index.tsx
index baad29dc0..1b5606678 100644
--- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/BookingCodeFilter/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/BookingCodeFilter/index.tsx
@@ -63,26 +63,25 @@ export default function BookingCodeFilter() {
appendRegularRates(room?.roomConfigurations)
}
- const hideFilterDespiteBookingCode =
- rooms.length &&
- rooms.every((room) =>
- room.products.every((product) => {
- const isRedemption = Array.isArray(product)
- if (isRedemption) {
- return true
- }
- const isCorporateCheque =
- product.rateDefinition?.rateType === RateTypeEnum.CorporateCheque
- const isVoucher =
- product.rateDefinition?.rateType === RateTypeEnum.Voucher
- return isCorporateCheque || isVoucher
- })
- )
+ const hideFilter = rooms.some((room) =>
+ room.products.some((product) => {
+ const isRedemption = Array.isArray(product)
+ if (isRedemption) {
+ return true
+ }
- if (
- (booking.bookingCode && hideFilterDespiteBookingCode) ||
- !booking.bookingCode
- ) {
+ switch (product.rateDefinition.rateType) {
+ case RateTypeEnum.Arb:
+ case RateTypeEnum.CorporateCheque:
+ case RateTypeEnum.Voucher:
+ return true
+ default:
+ return false
+ }
+ })
+ )
+
+ if (hideFilter || !booking.bookingCode) {
return null
}
diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/RoomPackageFilter/utils.ts b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/RoomPackageFilter/utils.ts
index d965467f3..10348e855 100644
--- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/RoomPackageFilter/utils.ts
+++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/RoomsHeader/RoomPackageFilter/utils.ts
@@ -1,11 +1,11 @@
-import type { SymbolCodepoints } from "react-material-symbols"
+import type { MaterialSymbolProps } from "react-material-symbols"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import type { PackageEnum } from "@/types/requests/packages"
export function getIconNameByPackageCode(
packageCode: PackageEnum
-): SymbolCodepoints {
+): MaterialSymbolProps["icon"] {
switch (packageCode) {
case RoomPackageCodeEnum.PET_ROOM:
return "pets"
diff --git a/apps/scandic-web/components/SidePeeks/RoomSidePeek/bedIcon.ts b/apps/scandic-web/components/SidePeeks/RoomSidePeek/bedIcon.ts
index c0aa4b2f3..b87a12bb1 100644
--- a/apps/scandic-web/components/SidePeeks/RoomSidePeek/bedIcon.ts
+++ b/apps/scandic-web/components/SidePeeks/RoomSidePeek/bedIcon.ts
@@ -1,6 +1,6 @@
-import type { SymbolCodepoints } from "react-material-symbols"
+import type { MaterialSymbolProps } from "react-material-symbols"
-export function getBedIconName(name: string): SymbolCodepoints {
+export function getBedIconName(name: string): MaterialSymbolProps["icon"] {
const iconMappings = [
{
icon: "bed",
@@ -25,5 +25,5 @@ export function getBedIconName(name: string): SymbolCodepoints {
]
const icon = iconMappings.find((icon) => icon.texts.includes(name))
- return icon ? (icon.icon as SymbolCodepoints) : "single_bed"
+ return icon ? (icon.icon as MaterialSymbolProps["icon"]) : "single_bed"
}
diff --git a/apps/scandic-web/i18n/dictionaries/da.json b/apps/scandic-web/i18n/dictionaries/da.json
index 948503116..9a40fec19 100644
--- a/apps/scandic-web/i18n/dictionaries/da.json
+++ b/apps/scandic-web/i18n/dictionaries/da.json
@@ -608,7 +608,7 @@
"Pet room charge including VAT": "Gebyr for kæledyrsværelse inkl. moms",
"Pet-friendly": "Kæledyrsvenlig",
"Pet-friendly rooms have an additional fee of 20 EUR per stay": "Kæledyrsrum har en ekstra gebyr på 20 EUR per ophold",
- "Pet-friendly rooms include a charge of approx. {price}/stay": "Kæledyrsvenlige værelser inkluderer et gebyr på ca. {price}/ophold",
+ "Pet-friendly rooms include a charge of approx. {price}/stay": "Kæledyrsvenlige værelser inkluderer et gebyr på ca. {price}/ophold",
"Phone": "Telefon",
"Phone is required": "Telefonnummer er påkrævet",
"Phone number": "Telefonnummer",
diff --git a/apps/scandic-web/i18n/dictionaries/de.json b/apps/scandic-web/i18n/dictionaries/de.json
index 0ca62cb1c..c21828716 100644
--- a/apps/scandic-web/i18n/dictionaries/de.json
+++ b/apps/scandic-web/i18n/dictionaries/de.json
@@ -607,7 +607,7 @@
"Pet room charge including VAT": "Haustierzimmergebühr inkl. MwSt.",
"Pet-friendly": "Haustierfreundlich",
"Pet-friendly rooms have an additional fee of 20 EUR per stay": "Haustierzimmer haben einen zusätzlichen Preis von 20 EUR pro Aufenthalt",
- "Pet-friendly rooms include a charge of approx. {price}/stay": "Für haustierfreundliche Zimmer fällt eine Gebühr von ca. {price}/Aufenthalt an.",
+ "Pet-friendly rooms include a charge of approx. {price}/stay": "Für haustierfreundliche Zimmer fällt eine Gebühr von ca. {price}/Aufenthalt an.",
"Phone": "Telefon",
"Phone is required": "Telefon ist erforderlich",
"Phone number": "Telefonnummer",
diff --git a/apps/scandic-web/i18n/dictionaries/fi.json b/apps/scandic-web/i18n/dictionaries/fi.json
index 3ae232090..721c6283f 100644
--- a/apps/scandic-web/i18n/dictionaries/fi.json
+++ b/apps/scandic-web/i18n/dictionaries/fi.json
@@ -606,7 +606,7 @@
"Pet room charge including VAT": "Lemmikkihuoneen maksu sis. ALV",
"Pet-friendly": "Lemmikkiystävällinen",
"Pet-friendly rooms have an additional fee of 20 EUR per stay": "Lemmikkihuoneen lisäkustannus on 20 EUR per majoitus",
- "Pet-friendly rooms include a charge of approx. {price}/stay": "Lemmikkiystävälliset huoneet sisältävät n. {price}/yöpyminen",
+ "Pet-friendly rooms include a charge of approx. {price}/stay": "Lemmikkiystävälliset huoneet sisältävät n. {price}/yöpyminen",
"Phone": "Puhelin",
"Phone is required": "Puhelin vaaditaan",
"Phone number": "Puhelinnumero",
diff --git a/apps/scandic-web/i18n/dictionaries/no.json b/apps/scandic-web/i18n/dictionaries/no.json
index 209474e67..6122b6a20 100644
--- a/apps/scandic-web/i18n/dictionaries/no.json
+++ b/apps/scandic-web/i18n/dictionaries/no.json
@@ -605,7 +605,7 @@
"Pet room charge including VAT": "Kjæledyrromsgebyr inkl. MVA",
"Pet-friendly": "Dyrevennlig",
"Pet-friendly rooms have an additional fee of 20 EUR per stay": "Kjæledyrsrom har en tilleggsavgift på 20 EUR per opphold",
- "Pet-friendly rooms include a charge of approx. {price}/stay": "Kjæledyrvennlige rom inkluderer en kostnad på ca. {price}/opphold",
+ "Pet-friendly rooms include a charge of approx. {price}/stay": "Kjæledyrvennlige rom inkluderer en kostnad på ca. {price}/opphold",
"Phone": "Telefon",
"Phone is required": "Telefon kreves",
"Phone number": "Telefonnummer",
diff --git a/apps/scandic-web/i18n/dictionaries/sv.json b/apps/scandic-web/i18n/dictionaries/sv.json
index 8a6fd60e6..445d58b1c 100644
--- a/apps/scandic-web/i18n/dictionaries/sv.json
+++ b/apps/scandic-web/i18n/dictionaries/sv.json
@@ -605,7 +605,7 @@
"Pet room charge including VAT": "Avgift för husdjursrum inkl. moms",
"Pet-friendly": "Husdjursvänlig",
"Pet-friendly rooms have an additional fee of 20 EUR per stay": "Husdjursrum har en extra avgift på 20 EUR per vistelse",
- "Pet-friendly rooms include a charge of approx. {price}/stay": "Husdjursvänliga rum har en avgift på ca. {price}/vistelse",
+ "Pet-friendly rooms include a charge of approx. {price}/stay": "Husdjursvänliga rum har en avgift på ca. {price}/vistelse",
"Phone": "Telefon",
"Phone is required": "Telefonnummer är obligatorisk",
"Phone number": "Telefonnummer",
diff --git a/apps/scandic-web/lib/trpc/memoizedRequests/index.ts b/apps/scandic-web/lib/trpc/memoizedRequests/index.ts
index 2bc5715e9..de13601a5 100644
--- a/apps/scandic-web/lib/trpc/memoizedRequests/index.ts
+++ b/apps/scandic-web/lib/trpc/memoizedRequests/index.ts
@@ -339,7 +339,7 @@ export const getJumpToData = cache(async function getMemoizedJumpToData() {
return null
})
-export const getSelectedRoomsAvailability = cache(
+export const getSelectedRoomsAvailabilityEnterDetails = cache(
async function getMemoizedSelectedRoomsAvailability(
input: RoomsAvailabilityExtendedInputSchema
) {
diff --git a/apps/scandic-web/server/routers/hotels/utils.ts b/apps/scandic-web/server/routers/hotels/utils.ts
index a1e04b75c..156a18361 100644
--- a/apps/scandic-web/server/routers/hotels/utils.ts
+++ b/apps/scandic-web/server/routers/hotels/utils.ts
@@ -1252,12 +1252,12 @@ export async function getRoomsAvailability(
const cacheClient = await getCacheClient()
const availabilityResponses = await Promise.allSettled(
- rooms.map(async (room: RoomsAvailabilityInputRoom) => {
+ rooms.map((room: RoomsAvailabilityInputRoom) => {
const cacheKey = {
...baseCacheKey,
room,
}
- return await cacheClient.cacheOrGet(
+ return cacheClient.cacheOrGet(
stringify(cacheKey),
async function () {
{