(null)
const reward = intl.formatMessage({ id: "Book Reward Night" })
const redemptionErr = errors[REDEMPTION]
- const bookingCode = getValues("bookingCode.value")
const isMultiRoomError = redemptionErr?.message?.indexOf("Multi-room") === 0
- const errorInfoColor = isMultiRoomError ? "red" : "blue"
function validateRedemption(value: boolean) {
// Validate redemption as per the rules defined in the schema
trigger(REDEMPTION)
- if (value && bookingCode) {
+ if (value && getValues("bookingCode.value")) {
+ setValue("bookingCode.flag", false)
setValue("bookingCode.value", "", { shouldValidate: true })
// Hide the notification popup after 5 seconds by re-triggering validation
// This is kept consistent with location search field error notification timeout
@@ -87,15 +86,8 @@ export default function RewardNight() {
{redemptionErr && (
-
-
+
+
{intl.formatMessage({ id: redemptionErr.message })}
{isMultiRoomError ? : null}
diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/RewardNight/reward-night.module.css b/apps/scandic-web/components/Forms/BookingWidget/FormContent/RewardNight/reward-night.module.css
index 150e7aa86..e9b8772fc 100644
--- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/RewardNight/reward-night.module.css
+++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/RewardNight/reward-night.module.css
@@ -12,7 +12,6 @@
.error {
display: flex;
gap: var(--Spacing-x-half);
- align-items: center;
}
.errorIcon {
diff --git a/apps/scandic-web/components/Forms/BookingWidget/schema.ts b/apps/scandic-web/components/Forms/BookingWidget/schema.ts
index 40b760b48..6b0f71786 100644
--- a/apps/scandic-web/components/Forms/BookingWidget/schema.ts
+++ b/apps/scandic-web/components/Forms/BookingWidget/schema.ts
@@ -104,10 +104,7 @@ export const bookingWidgetSchema = z
path: ["search"],
})
}
- if (
- value.rooms.length > 1 &&
- value.bookingCode?.value.toLowerCase().startsWith("vo")
- ) {
+ if (value.rooms.length > 1 && value.bookingCode?.value.startsWith("VO")) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: "Multi-room booking is not available with this booking code.",
@@ -119,18 +116,6 @@ export const bookingWidgetSchema = z
path: ["rooms"],
})
}
- if (value.rooms.length > 1 && value.redemption) {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: "Multi-room booking is not available with reward night.",
- path: ["bookingCode.value"],
- })
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: "Multi-room booking is not available with reward night.",
- path: ["rooms"],
- })
- }
if (value.rooms.length > 1 && value.redemption) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx
index 130538de9..a43d704ba 100644
--- a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx
@@ -11,6 +11,7 @@ import { formatPrice } from "@/utils/numberFormatting"
import styles from "./joinScandicFriendsCard.module.css"
import type { JoinScandicFriendsCardProps } from "@/types/components/hotelReservation/enterDetails/details"
+import { CurrencyEnum } from "@/types/enums/currency"
export default function JoinScandicFriendsCard({
name = "join",
@@ -35,8 +36,8 @@ export default function JoinScandicFriendsCard({
{
amount: formatPrice(
intl,
- room.roomRate.memberRate.localPrice.pricePerStay,
- room.roomRate.memberRate.localPrice.currency
+ room.roomRate.memberRate.localPrice.pricePerStay ?? 0,
+ room.roomRate.memberRate.localPrice.currency ?? CurrencyEnum.Unknown
),
roomNr,
}
diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx
index 36e6530ed..5bc3e5d6d 100644
--- a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx
@@ -17,6 +17,7 @@ import { formatPrice } from "@/utils/numberFormatting"
import styles from "./joinScandicFriendsCard.module.css"
import type { JoinScandicFriendsCardProps } from "@/types/components/hotelReservation/enterDetails/details"
+import { CurrencyEnum } from "@/types/enums/currency"
export default function JoinScandicFriendsCard({
name = "join",
@@ -42,8 +43,8 @@ export default function JoinScandicFriendsCard({
{
amount: formatPrice(
intl,
- room.roomRate.memberRate.localPrice.pricePerStay,
- room.roomRate.memberRate.localPrice.currency
+ room.roomRate.memberRate.localPrice.pricePerStay ?? 0,
+ room.roomRate.memberRate.localPrice.currency ?? CurrencyEnum.Unknown
),
}
)
diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/MemberPriceModal/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/MemberPriceModal/index.tsx
index 83bff3d40..0f638d797 100644
--- a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/MemberPriceModal/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/MemberPriceModal/index.tsx
@@ -15,6 +15,8 @@ import styles from "./modal.module.css"
import type { Dispatch, SetStateAction } from "react"
+import { CurrencyEnum } from "@/types/enums/currency"
+
export default function MemberPriceModal({
isOpen,
setIsOpen,
@@ -49,8 +51,8 @@ export default function MemberPriceModal({
{formatPrice(
intl,
- memberPrice.pricePerStay,
- memberPrice.currency
+ memberPrice.pricePerStay ?? 0,
+ memberPrice.currency ?? CurrencyEnum.Unknown
)}
diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/PriceDetailsTable/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/PriceDetailsTable/index.tsx
index 535f3ee5f..d299b20dc 100644
--- a/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/PriceDetailsTable/index.tsx
+++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/PriceDetailsTable/index.tsx
@@ -14,6 +14,7 @@ import { formatPrice } from "@/utils/numberFormatting"
import styles from "./priceDetailsTable.module.css"
import type { Price } from "@/types/components/hotelReservation/price"
+import { CurrencyEnum } from "@/types/enums/currency"
import type { RoomState } from "@/types/stores/enter-details"
function Row({
@@ -117,6 +118,8 @@ export default function PriceDetailsTable({
getMemberRate && room.roomRate.memberRate
? room.roomRate.memberRate
: room.roomRate.publicRate
+ const voucherPrice = room.roomRate.voucherRate
+ const chequePrice = room.roomRate.chequeRate
if (!price) {
return null
}
@@ -129,42 +132,72 @@ export default function PriceDetailsTable({