From c0b543f18dcd78c238b116cb2731e8fda399bcef Mon Sep 17 00:00:00 2001 From: Tobias Johansson Date: Fri, 14 Mar 2025 12:39:50 +0000 Subject: [PATCH] Merged in feat/SW-1437-price-change-scenario (pull request #1532) Feat/SW-1437 price change scenario * wip price change scenario * feat(SW-1437): added updated room prices to summary * fix: spinner not centered on page * fix: feedback fixes Approved-by: Arvid Norlin Approved-by: Simon.Emanuelsson --- .../payment-callback/layout.module.css | 1 + .../Payment/PaymentCallback/index.tsx | 2 +- .../EnterDetails/Payment/PaymentClient.tsx | 31 ++- .../EnterDetails/Payment/helpers.ts | 7 +- .../PriceChangeSummary/index.tsx | 196 ++++++++++++++++++ .../priceChangeSummary.module.css | 96 +++++++++ .../EnterDetails/PriceChangeDialog/index.tsx | 98 +++++++-- .../priceChangeDialog.module.css | 53 +++-- apps/scandic-web/i18n/dictionaries/da.json | 11 +- apps/scandic-web/i18n/dictionaries/de.json | 11 +- apps/scandic-web/i18n/dictionaries/en.json | 9 +- apps/scandic-web/i18n/dictionaries/fi.json | 11 +- apps/scandic-web/i18n/dictionaries/no.json | 11 +- apps/scandic-web/i18n/dictionaries/sv.json | 13 +- .../hotelReservation/enterDetails/payment.ts | 6 + .../enterDetails/priceChangeDialog.ts | 8 - 16 files changed, 489 insertions(+), 75 deletions(-) create mode 100644 apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx create mode 100644 apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/priceChangeSummary.module.css delete mode 100644 apps/scandic-web/types/components/hotelReservation/enterDetails/priceChangeDialog.ts diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.module.css b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.module.css index 1730ffa68..a04e8416b 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.module.css +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.module.css @@ -1,3 +1,4 @@ .layout { background-color: var(--Base-Background-Primary-Normal); + min-height: 100dvh; } diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/index.tsx index 81510f33d..e0a148dff 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/index.tsx @@ -56,5 +56,5 @@ export default function PaymentCallback({ } }, [returnUrl, router, searchObject, status, errorMessage]) - return + return } diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx index bf29da71c..9ae43dda7 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx @@ -51,7 +51,10 @@ import { type PaymentFormData, paymentSchema } from "./schema" import styles from "./payment.module.css" -import type { PaymentClientProps } from "@/types/components/hotelReservation/enterDetails/payment" +import type { + PaymentClientProps, + PriceChangeData, +} from "@/types/components/hotelReservation/enterDetails/payment" import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter" const maxRetries = 15 @@ -97,10 +100,8 @@ export default function PaymentClient({ const availablePaymentOptions = useAvailablePaymentOptions(otherPaymentOptions) - const [priceChangeData, setPriceChangeData] = useState<{ - oldPrice: number - newPrice: number - } | null>() + const [priceChangeData, setPriceChangeData] = + useState(null) const { toDate, fromDate, hotelId } = booking @@ -143,15 +144,12 @@ export default function PaymentClient({ setBookingNumber(result.id) - const priceChange = result.rooms.find( - (r) => r.priceChangedMetadata - )?.priceChangedMetadata - - if (priceChange) { - setPriceChangeData({ - oldPrice: rooms[0].room.roomPrice.perStay.local.price, - newPrice: priceChange.totalPrice, - }) + const hasPriceChange = result.rooms.some((r) => r.priceChangedMetadata) + if (hasPriceChange) { + const priceChangeData = result.rooms.map( + (room) => room.priceChangedMetadata || null + ) + setPriceChangeData(priceChangeData) } else { setIsPollingForBookingStatus(true) } @@ -172,7 +170,6 @@ export default function PaymentClient({ } else { handlePaymentError("No confirmation number") } - setPriceChangeData(null) }, onError: (error) => { @@ -518,8 +515,8 @@ export default function PaymentClient({ {priceChangeData ? ( { const allSearchParams = searchParams.size diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/helpers.ts b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/helpers.ts index e990b15ec..9a4eea581 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/helpers.ts +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/helpers.ts @@ -14,8 +14,11 @@ export function hasPrepaidRate({ room }: RoomState): boolean { return !room.isFlexRate } -export function calculateTotalRoomPrice({ room }: RoomState) { - let totalPrice = room.roomPrice.perStay.local.price +export function calculateTotalRoomPrice( + { room }: RoomState, + initialRoomPrice?: number +) { + let totalPrice = initialRoomPrice ?? room.roomPrice.perStay.local.price if (room.breakfast) { totalPrice += Number(room.breakfast.localPrice.totalPrice) * room.adults diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx new file mode 100644 index 000000000..9e45311cc --- /dev/null +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx @@ -0,0 +1,196 @@ +"use client" + +import { useState, Fragment } from "react" +import { + Dialog, + DialogTrigger, + Modal, + ModalOverlay, +} from "react-aria-components" +import { useIntl } from "react-intl" + +import { ChevronRightSmallIcon, CloseLargeIcon } from "@/components/Icons" +import Button from "@/components/TempDesignSystem/Button" +import Divider from "@/components/TempDesignSystem/Divider" +import Body from "@/components/TempDesignSystem/Text/Body" +import Caption from "@/components/TempDesignSystem/Text/Caption" +import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import { formatPrice } from "@/utils/numberFormatting" + +import styles from "./priceChangeSummary.module.css" + +import type { RoomState } from "@/types/stores/enter-details" + +interface PriceChangeSummaryProps { + rooms: RoomState[] + roomPrices: { prevPrice: number; newPrice?: number }[] + newTotalPrice: { price: number; currency: string } + onAccept: () => void + onCancel: () => void +} + +export default function PriceChangeSummary({ + rooms, + roomPrices, + newTotalPrice, + onAccept, + onCancel, +}: PriceChangeSummaryProps) { + const intl = useIntl() + const [isOpen, toggleOpen] = useState(false) + + return ( + + + + + + {({ close }) => ( +
+
+ + {intl.formatMessage({ id: "Price details" })} + + +
+
+
+ {rooms.map(({ room }, idx) => { + const roomNumber = idx + 1 + const newPrice = roomPrices[idx].newPrice + + return ( + +
+ + {rooms.length > 1 + ? intl.formatMessage( + { id: "Room {roomIndex}" }, + { roomIndex: roomNumber } + ) + : intl.formatMessage({ id: "Room" })} + + {room.roomType} +
+ + {intl.formatMessage({ id: "Room charge" })} + + {newPrice ? ( +
+ + {formatPrice( + intl, + room.roomPrice.perStay.local.price, + room.roomPrice.perStay.local.currency + )} + + + {formatPrice( + intl, + newPrice, + room.roomPrice.perStay.local.currency + )} + +
+ ) : ( + + {formatPrice( + intl, + room.roomPrice.perStay.local.price, + room.roomPrice.perStay.local.currency + )} + + )} +
+ {room.breakfast && ( +
+ + {intl.formatMessage({ + id: "Breakfast charge", + })} + + + {formatPrice( + intl, + Number( + room.breakfast.localPrice.totalPrice + ), + room.breakfast.localPrice.currency + )} + +
+ )} + {room.roomFeatures?.map((feature) => ( +
+ + {feature.description} + + + {formatPrice( + intl, + Number(feature.localPrice.totalPrice), + feature.localPrice.currency + )} + +
+ ))} +
+ +
+ ) + })} +
+
+ {intl.formatMessage({ id: "Total" })} +
+ + {intl.formatMessage({ id: "Price including VAT" })} + + + {formatPrice( + intl, + newTotalPrice.price, + newTotalPrice.currency + )} + +
+
+
+
+ + +
+
+ )} +
+
+
+
+ ) +} diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/priceChangeSummary.module.css b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/priceChangeSummary.module.css new file mode 100644 index 000000000..5c7231ac5 --- /dev/null +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/priceChangeSummary.module.css @@ -0,0 +1,96 @@ +.dialog { + position: fixed; + inset: 0; + width: 100dvw; + height: 100dvh; + background-color: var(--Base-Background-Primary-Normal); + z-index: 200; + overflow: auto; + + display: flex; + justify-content: center; + align-items: flex-start; +} + +.header { + display: flex; + justify-content: center; +} + +.content { + width: 100%; + height: 100%; + padding: var(--Spacing-x4); + display: flex; + flex-direction: column; + gap: var(--Spacing-x4); +} + +.closeButton { + position: absolute; + top: var(--Spacing-x4); + right: var(--Spacing-x4); +} + +.roomsSection { + display: flex; + flex-direction: column; + overflow: auto; +} + +.rowContainer { + padding: var(--Spacing-x2) 0; + display: flex; + flex-direction: column; + gap: var(--Spacing-x1); +} + +.roomContainer:first-child { + padding-top: 0; +} + +.roomContainer:last-child { + padding-bottom: 0; +} + +.priceRow { + display: flex; + justify-content: space-between; +} + +.updatedPrice { + display: flex; + align-items: center; + gap: var(--Spacing-x1); +} + +.footer { + display: flex; + flex-direction: column-reverse; + justify-content: center; + gap: var(--Spacing-x2); + padding-top: var(--Spacing-x6); + margin-top: auto; +} + +@media screen and (min-width: 1367px) { + .dialog { + padding: var(--Spacing-x6); + align-items: center; + } + + .header { + justify-content: flex-start; + } + + .content { + width: 512px; + height: fit-content; + padding: 0; + } + + .footer { + flex-direction: row; + padding: var(--Spacing-x6) 0; + } +} diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx index 4e32ab6b1..a2bdc9cd6 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx @@ -1,26 +1,68 @@ import { Dialog, Modal, ModalOverlay } from "react-aria-components" import { useIntl } from "react-intl" +import { useEnterDetailsStore } from "@/stores/enter-details" + import { InfoCircleIcon } from "@/components/Icons" import Button from "@/components/TempDesignSystem/Button" import Body from "@/components/TempDesignSystem/Text/Body" +import Caption from "@/components/TempDesignSystem/Text/Caption" +import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import Title from "@/components/TempDesignSystem/Text/Title" import { formatPrice } from "@/utils/numberFormatting" -import styles from "./priceChangeDialog.module.css" +import { calculateTotalRoomPrice } from "../Payment/helpers" +import PriceChangeSummary from "./PriceChangeSummary" -import type { PriceChangeDialogProps } from "@/types/components/hotelReservation/enterDetails/priceChangeDialog" +import styles from "./priceChangeDialog.module.css" +import { PriceChangeData } from "@/types/components/hotelReservation/enterDetails/payment" + +type PriceDetailsState = { + newTotalPrice: number + roomPrices: { prevPrice: number; newPrice?: number }[] +} + +type PriceChangeDialogProps = { + isOpen: boolean + priceChangeData: PriceChangeData + prevTotalPrice: number + currency: string + onCancel: () => void + onAccept: () => void +} export default function PriceChangeDialog({ isOpen, - oldPrice, - newPrice, + priceChangeData, + prevTotalPrice, currency, onCancel, onAccept, }: PriceChangeDialogProps) { const intl = useIntl() - const title = intl.formatMessage({ id: "The price has increased" }) + const title = intl.formatMessage({ id: "Price change" }) + const rooms = useEnterDetailsStore((state) => state.rooms) + + const { newTotalPrice, roomPrices } = rooms.reduce( + (acc, room, idx) => { + const roomPrice = room.room.roomPrice.perStay.local.price + const priceChange = priceChangeData[idx] + + const { totalPrice } = calculateTotalRoomPrice( + room, + priceChange?.roomPrice + ) + acc.newTotalPrice += totalPrice + + acc.roomPrices.push({ + prevPrice: roomPrice, + newPrice: priceChange?.roomPrice, + }) + + return acc + }, + { newTotalPrice: 0, roomPrices: [] } + ) return ( {title} - {intl.formatMessage({ - id: "The price has increased since you selected your room.", - })} -
- {intl.formatMessage({ - id: "You can still book the room but you need to confirm that you accept the new price", - })} -
- - {formatPrice(intl, oldPrice, currency)} - - - {formatPrice(intl, newPrice, currency)} - + {intl.formatMessage( + { + id: "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.", + }, + { totalRooms: rooms.length, br:
} + )} +
+ + {intl.formatMessage({ id: "New total" })} + +
+ + {formatPrice(intl, prevTotalPrice, currency)} + + + {formatPrice(intl, newTotalPrice, currency)} + +
+
+
diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/priceChangeDialog.module.css b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/priceChangeDialog.module.css index a695d973f..a31f493ad 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/priceChangeDialog.module.css +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/priceChangeDialog.module.css @@ -19,17 +19,19 @@ } .overlay { - align-items: center; - background: rgba(0, 0, 0, 0.5); - display: flex; - height: var(--visual-viewport-height); - justify-content: center; - left: 0; position: fixed; + left: 0; top: 0; - width: 100vw; + width: 100%; z-index: 100; + display: flex; + align-items: flex-end; + justify-content: center; + + background: var(--Overlay-60); + height: var(--visual-viewport-height); + &[data-entering] { animation: modal-fade 200ms; } @@ -50,12 +52,15 @@ .dialog { background-color: var(--Scandic-Brand-Pale-Peach); - border-radius: var(--Corner-radius-Medium); + border-top-left-radius: var(--Corner-radius-Medium); + border-top-right-radius: var(--Corner-radius-Medium); + box-shadow: var(--modal-box-shadow); display: flex; flex-direction: column; - gap: var(--Spacing-x2); + gap: var(--Spacing-x4); padding: var(--Spacing-x5) var(--Spacing-x4); + width: 100dvw; } .header { @@ -68,18 +73,40 @@ display: flex; flex-direction: column; align-items: center; + gap: var(--Spacing-x1); } .footer { display: flex; + flex-direction: column-reverse; justify-content: center; gap: var(--Spacing-x2); } -.oldPrice { - text-decoration: line-through; +.modal .prices { + display: flex; + align-items: center; + justify-content: center; + gap: var(--Spacing-x-half); + padding-top: var(--Spacing-x-half); } -.newPrice { - font-size: 1.2em; +@media screen and (min-width: 1367px) { + .overlay { + align-items: center; + } + + .dialog { + border-radius: var(--Corner-radius-Medium); + padding: var(--Spacing-x6); + width: fit-content; + } + + .content { + width: 512px; + } + + .footer { + flex-direction: row; + } } diff --git a/apps/scandic-web/i18n/dictionaries/da.json b/apps/scandic-web/i18n/dictionaries/da.json index cdea2f991..9085ca5fe 100644 --- a/apps/scandic-web/i18n/dictionaries/da.json +++ b/apps/scandic-web/i18n/dictionaries/da.json @@ -78,6 +78,7 @@ "Away from elevator": "Væk fra elevator", "Back": "Tilbage", "Back to scandichotels.com": "Tilbage til scandichotels.com", + "Back to select room": "Tilbage til at vælge værelse", "Back to top": "Tilbage til top", "Bar": "Bar", "Based on availability": "Baseret på tilgængelighed", @@ -183,6 +184,7 @@ "Contact us": "Kontakt os", "Continue": "Blive ved", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Fortsæt med ny pris", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Kunne ikke finde den anmodede ressource", @@ -464,6 +466,7 @@ "Nearby": "I nærheden", "Nearby companies": "Nærliggende virksomheder", "New password": "Nyt kodeord", + "New total": "Ny total", "Next": "Næste", "Nightlife": "Natteliv", "Nights needed to level up": "Nætter nødvendige for at komme i niveau", @@ -555,6 +558,7 @@ "Previous victories": "Tidligere sejre", "Price": "Pris", "Price 0,16 €/min + local call charges": "Pris 0,16 €/min + lokale opkaldstakster", + "Price change": "Prisændring", "Price details": "Prisoplysninger", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "Pris ekskl. moms", @@ -564,10 +568,11 @@ "Price per day": "Pris per dag", "Price per night": "Pris per nat", "Prices": "Priser", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Priserne er steget siden du valgte dit {totalRooms, plural, one {værelse} other {værelser}}.{br} For at fortsætte din booking, accepter den opdaterede pris,{br} eller gå tilbage for at vælge {totalRooms, plural, one {et nyt værelse} other {nya værelser}}.", "Print confirmation": "Print confirmation", "Proceed to login": "Fortsæt til login", "Proceed to payment": "Fortsæt til betalingsmetode", - "Proceed to payment method": "Proceed to payment method", + "Proceed to payment method": "Gå videre til betalingsmetode", "Promo code": "Promo code", "Provide a payment card in the next step": "Giv os dine betalingsoplysninger i næste skridt", "Public price from": "Offentlig pris fra", @@ -627,6 +632,7 @@ "See hotel information": "Se hoteloplysninger", "See map": "Vis kort", "See on map": "Se på kort", + "See price details": "Se prisdetaljer", "See results ({ count })": "Se resultater ({ count })", "See room details": "Se værelsesdetaljer", "See rooms": "Se værelser", @@ -896,5 +902,6 @@ "{value} cm": "{value} cm", "{value} m²": "{number} m²", "{value} points": "{value} point", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle rettigheder forbeholdes" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle rettigheder forbeholdes", + "Room": "Værelse" } diff --git a/apps/scandic-web/i18n/dictionaries/de.json b/apps/scandic-web/i18n/dictionaries/de.json index 2e4a64120..bace5d790 100644 --- a/apps/scandic-web/i18n/dictionaries/de.json +++ b/apps/scandic-web/i18n/dictionaries/de.json @@ -79,6 +79,7 @@ "Away from elevator": "Weg vom Aufzug", "Back": "Zurück", "Back to scandichotels.com": "Zurück zu scandichotels.com", + "Back to select room": "Zurück zur Zimmerauswahl", "Back to top": "Zurück zur Spitze", "Bar": "Bar", "Based on availability": "Je nach Verfügbarkeit", @@ -184,6 +185,7 @@ "Contact us": "Kontaktieren Sie uns", "Continue": "Weitermachen", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Mit neuer Preis fortsetzen", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Die angeforderte Ressource konnte nicht gefunden werden.", @@ -465,6 +467,7 @@ "Nearby": "In der Nähe", "Nearby companies": "Nahe gelegene Unternehmen", "New password": "Neues Kennwort", + "New total": "Neue Gesamt", "Next": "Nächste", "Nightlife": "Nachtleben", "Nights needed to level up": "Nächte, die zum Levelaufstieg benötigt werden", @@ -554,6 +557,7 @@ "Previous victories": "Bisherige Siege", "Price": "Preis", "Price 0,16 €/min + local call charges": "Preis 0,16 €/Min. + Ortsgesprächsgebühren", + "Price change": "Preisänderung", "Price details": "Preisdetails", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "Preis ohne MwSt.", @@ -563,10 +567,11 @@ "Price per day": "Preis pro Tag", "Price per night": "Preis pro Nacht", "Prices": "Preise", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Die Preise haben sich seitdem erhöht, dass Sie Ihr {totalRooms, plural, one {Zimmer} other {Zimmer}} ausgewählt haben.{br} Um Ihre Buchung fortzusetzen, akzeptieren Sie den aktualisierten Preis,{br} oder gehen Sie zurück, um {totalRooms, plural, one {ein neues Zimmer} other {neue Zimmer}} auszuwählen.", "Print confirmation": "Print confirmation", "Proceed to login": "Weiter zum Login", "Proceed to payment": "Weiter zur Zahlungsmethode", - "Proceed to payment method": "Proceed to payment method", + "Proceed to payment method": "Zum Zahlungsmethode wechseln", "Promo code": "Promo code", "Provide a payment card in the next step": "Geben Sie Ihre Zahlungskarteninformationen im nächsten Schritt an", "Public price from": "Öffentlicher Preis ab", @@ -626,6 +631,7 @@ "See hotel information": "Siehe Hotelinformationen", "See map": "Karte anzeigen", "See on map": "Karte ansehen", + "See price details": "Preisdetails ansehen", "See results ({ count })": "Ergebnisse anzeigen ({ count })", "See room details": "Zimmerdetails ansehen", "See rooms": "Zimmer ansehen", @@ -894,5 +900,6 @@ "{value} cm": "{value} cm", "{value} m²": "{number} m²", "{value} points": "{value} punkte", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle Rechte vorbehalten" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle Rechte vorbehalten", + "Room": "Zimmer" } diff --git a/apps/scandic-web/i18n/dictionaries/en.json b/apps/scandic-web/i18n/dictionaries/en.json index 9f8bc2a2e..fb9e40dee 100644 --- a/apps/scandic-web/i18n/dictionaries/en.json +++ b/apps/scandic-web/i18n/dictionaries/en.json @@ -77,6 +77,7 @@ "Away from elevator": "Away from elevator", "Back": "Back", "Back to scandichotels.com": "Back to scandichotels.com", + "Back to select room": "Back to select room", "Back to top": "Back to top", "Bar": "Bar", "Based on availability": "Based on availability", @@ -182,6 +183,7 @@ "Contact us": "Contact us", "Continue": "Continue", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Continue with new price", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Could not find requested resource", @@ -463,6 +465,7 @@ "Nearby": "Nearby", "Nearby companies": "Nearby companies", "New password": "New password", + "New total": "New total", "Next": "Next", "Nightlife": "Nightlife", "Nights needed to level up": "Nights needed to level up", @@ -553,6 +556,7 @@ "Previous victories": "Previous victories", "Price": "Price", "Price 0,16 €/min + local call charges": "Price 0,16 €/min + local call charges", + "Price change": "Price change", "Price details": "Price details", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "Price excluding VAT", @@ -562,6 +566,7 @@ "Price per day": "Price per day", "Price per night": "Price per night", "Prices": "Prices", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.", "Print confirmation": "Print confirmation", "Proceed to login": "Proceed to login", "Proceed to payment": "Proceed to payment", @@ -625,6 +630,7 @@ "See hotel information": "See hotel information", "See map": "See map", "See on map": "See on map", + "See price details": "See price details", "See results ({ count })": "See results ({ count })", "See room details": "See room details", "See rooms": "See rooms", @@ -889,5 +895,6 @@ "{value} cm": "{value} cm", "{value} m²": "{value} m²", "{value} points": "{value} points", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB All rights reserved" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB All rights reserved", + "Room": "Room" } diff --git a/apps/scandic-web/i18n/dictionaries/fi.json b/apps/scandic-web/i18n/dictionaries/fi.json index 58da95095..644489f63 100644 --- a/apps/scandic-web/i18n/dictionaries/fi.json +++ b/apps/scandic-web/i18n/dictionaries/fi.json @@ -77,6 +77,7 @@ "Away from elevator": "Kaukana hissistä", "Back": "Takaisin", "Back to scandichotels.com": "Takaisin scandichotels.com", + "Back to select room": "Palaa huoneen valintaan", "Back to top": "Takaisin ylös", "Bar": "Bar", "Based on availability": "Saatavuuden mukaan", @@ -183,6 +184,7 @@ "Contact us": "Ota meihin yhteyttä", "Continue": "Jatkaa", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Jatka uudella hinnalla", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Pyydettyä resurssia ei löytynyt", @@ -464,6 +466,7 @@ "Nearby": "Lähistöllä", "Nearby companies": "Läheiset yritykset", "New password": "Uusi salasana", + "New total": "Uusi kokonais", "Next": "Seuraava", "Nightlife": "Yöelämä", "Nights needed to level up": "Yöt, joita tarvitaan tasolle", @@ -553,6 +556,7 @@ "Previous victories": "Edelliset voitot", "Price": "Hinta", "Price 0,16 €/min + local call charges": "Hinta 0,16 €/min + pvm", + "Price change": "Hinnan muutos", "Price details": "Hintatiedot", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "ALV ei sisälly hintaan", @@ -562,10 +566,11 @@ "Price per day": "Hinta per päivä", "Price per night": "Hinta per yö", "Prices": "Hinnat", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Hinnat ovat nousseet, koska valitsemasi huoneet ovat nyt käytettävissä. Jatkaaksesi varauksen, hyväksy uuden hinnan tai palaa valitsemaan {totalRooms, plural, one {uusi huone} other {uusia huoneita}}.", "Print confirmation": "Print confirmation", "Proceed to login": "Jatka kirjautumiseen", "Proceed to payment": "Siirry maksutavalle", - "Proceed to payment method": "Proceed to payment method", + "Proceed to payment method": "Siirry maksutapaan", "Promo code": "Promo code", "Provide a payment card in the next step": "Anna maksukortin tiedot seuraavassa vaiheessa", "Public price from": "Julkinen hinta alkaen", @@ -626,6 +631,7 @@ "See hotel information": "Katso hotellin tiedot", "See map": "Näytä kartta", "See on map": "Näytä kartalla", + "See price details": "Näytä hinnatiedot", "See results ({ count })": "Katso tulokset ({ count })", "See room details": "Katso huoneen tiedot", "See rooms": "Katso huoneet", @@ -894,5 +900,6 @@ "{value} cm": "{value} cm", "{value} m²": "{number} m²", "{value} points": "{value} pisteet", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Kaikki oikeudet pidätetään" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Kaikki oikeudet pidätetään", + "Room": "Huone" } diff --git a/apps/scandic-web/i18n/dictionaries/no.json b/apps/scandic-web/i18n/dictionaries/no.json index c84a8beec..aafcbd798 100644 --- a/apps/scandic-web/i18n/dictionaries/no.json +++ b/apps/scandic-web/i18n/dictionaries/no.json @@ -77,6 +77,7 @@ "Away from elevator": "Bort fra heisen", "Back": "Tilbake", "Back to scandichotels.com": "Tilbake til scandichotels.com", + "Back to select room": "Tilbake til å velge rom", "Back to top": "Tilbake til toppen", "Bar": "Bar", "Based on availability": "Basert på tilgjengelighet", @@ -182,6 +183,7 @@ "Contact us": "Kontakt oss", "Continue": "Fortsette", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Fortsett med ny pris", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Kunne ikke finne den forespurte ressursen", @@ -463,6 +465,7 @@ "Nearby": "I nærheten", "Nearby companies": "Nærliggende selskaper", "New password": "Nytt passord", + "New total": "Ny total", "Next": "Neste", "Nightlife": "Natteliv", "Nights needed to level up": "Netter som trengs for å komme opp i nivå", @@ -552,6 +555,7 @@ "Previous victories": "Tidligere seire", "Price": "Pris", "Price 0,16 €/min + local call charges": "Pris 0,16 €/min + lokale samtalekostnader", + "Price change": "Prisendring", "Price details": "Prisdetaljer", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "Pris exkludert mva", @@ -561,10 +565,11 @@ "Price per day": "Pris per dag", "Price per night": "Pris per natt", "Prices": "Priser", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Prisene har økt siden du valgte ditt {totalRooms, plural, one {rom} other {rom}}.{br} For å fortsette din bestilling, aksepterer du den oppdaterte prisen,{br} eller gå tilbake for å velge {totalRooms, plural, one {et nytt rom} other {nya rom}}.", "Print confirmation": "Print confirmation", "Proceed to login": "Fortsett til innlogging", "Proceed to payment": "Fortsett til betalingsmetode", - "Proceed to payment method": "Proceed to payment method", + "Proceed to payment method": "Gå videre til betalingsmetode", "Promo code": "Promo code", "Provide a payment card in the next step": "Gi oss dine betalingskortdetaljer i neste steg", "Public price from": "Offentlig pris fra", @@ -623,6 +628,7 @@ "See hotel information": "Se hotellinformasjon", "See map": "Vis kart", "See on map": "Se på kart", + "See price details": "Se prisdetaljer", "See results ({ count })": "Se resultater ({ count })", "See room details": "Se detaljer om rommet", "See rooms": "Se rom", @@ -890,5 +896,6 @@ "{value} cm": "{value} cm", "{value} m²": "{number} m²", "{value} points": "{value} poeng", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle rettigheter forbeholdt" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alle rettigheter forbeholdt", + "Room": "Rom" } diff --git a/apps/scandic-web/i18n/dictionaries/sv.json b/apps/scandic-web/i18n/dictionaries/sv.json index 11eb2f12f..d2c8950d5 100644 --- a/apps/scandic-web/i18n/dictionaries/sv.json +++ b/apps/scandic-web/i18n/dictionaries/sv.json @@ -77,6 +77,7 @@ "Away from elevator": "Bort från hissen", "Back": "Tillbaka", "Back to scandichotels.com": "Tillbaka till scandichotels.com", + "Back to select room": "Tillbaka till välj rum", "Back to top": "Tillbaka till toppen", "Bar": "Bar", "Based on availability": "Baserat på tillgänglighet", @@ -182,6 +183,7 @@ "Contact us": "Kontakta oss", "Continue": "Fortsätt", "Continue to room {nextRoomNumber}": "Continue to room {nextRoomNumber}", + "Continue with new price": "Fortsätt med nytt pris", "Copied to clipboard": "Copied to clipboard", "Copy promotion code": "Copy promotion code", "Could not find requested resource": "Det gick inte att hitta den begärda resursen", @@ -463,6 +465,7 @@ "Nearby": "I närheten", "Nearby companies": "Närliggande företag", "New password": "Nytt lösenord", + "New total": "Ny total", "Next": "Nästa", "Nightlife": "Nattliv", "Nights needed to level up": "Nätter som behövs för att gå upp i nivå", @@ -552,6 +555,7 @@ "Previous victories": "Tidigare segrar", "Price": "Pris", "Price 0,16 €/min + local call charges": "Pris 0,16 €/min + lokalsamtalsavgifter", + "Price change": "Prisändring", "Price details": "Prisdetaljer", "Price excl VAT": "Price excl VAT", "Price excluding VAT": "Pris exkl. VAT", @@ -561,10 +565,11 @@ "Price per day": "Pris per dag", "Price per night": "Pris per natt", "Prices": "Priser", + "Prices have increased since you selected your {totalRooms, plural, one {room} other {rooms}}.{br} To continue your booking, accept the updated price,{br} or go back to select {totalRooms, plural, one {a new room} other {new rooms}}.": "Priserna har ökat sedan du valde {totalRooms, plural, one {ditt rum} other {dina rum}}.{br} För att fortsätta din bokning, acceptera det uppdaterade priset,{br} eller gå tillbaka för att välja {totalRooms, plural, one {ett nytt rum} other {nya rum}}.", "Print confirmation": "Print confirmation", "Proceed to login": "Fortsätt till inloggning", "Proceed to payment": "Gå vidare till betalningsmetod", - "Proceed to payment method": "Proceed to payment method", + "Proceed to payment method": "Gå vidare till betalningsmetod", "Promo code": "Promo code", "Provide a payment card in the next step": "Ge oss dina betalkortdetaljer i nästa steg", "Public price from": "Offentligt pris från", @@ -587,7 +592,7 @@ "Remove card from member profile": "Ta bort kortet från medlemsprofilen", "Remove extra rooms": "Ta bort extra rum", "Remove room": "Remove room", - "Request bedtype": "Request bedtype", + "Request bedtype": "Begär sängtyp", "Reservation policy": "Reservation policy", "Reserve with Card": "Reservera med kort", "Restaurant & Bar": "Restaurang & Bar", @@ -624,6 +629,7 @@ "See hotel information": "Se hotellinformation", "See map": "Visa karta", "See on map": "Se på karta", + "See price details": "Se prisdetaljer", "See results ({ count })": "Se resultat ({ count })", "See room details": "Se rumsdetaljer", "See rooms": "Se rum", @@ -894,5 +900,6 @@ "{value} cm": "{value} cm", "{value} m²": "{number} m²", "{value} points": "{value} poäng", - "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alla rättigheter förbehålls" + "© {currentYear} Scandic AB All rights reserved": "© {currentYear} Scandic AB Alla rättigheter förbehålls", + "Room": "Rum" } diff --git a/apps/scandic-web/types/components/hotelReservation/enterDetails/payment.ts b/apps/scandic-web/types/components/hotelReservation/enterDetails/payment.ts index bffee538a..b6c477e3b 100644 --- a/apps/scandic-web/types/components/hotelReservation/enterDetails/payment.ts +++ b/apps/scandic-web/types/components/hotelReservation/enterDetails/payment.ts @@ -13,3 +13,9 @@ export interface PaymentClientProps extends Omit { savedCreditCards: CreditCard[] | null } + +export type PriceChangeData = Array<{ + roomPrice: number + totalPrice: number + packagePrice?: number +} | null> diff --git a/apps/scandic-web/types/components/hotelReservation/enterDetails/priceChangeDialog.ts b/apps/scandic-web/types/components/hotelReservation/enterDetails/priceChangeDialog.ts deleted file mode 100644 index 32ae4996d..000000000 --- a/apps/scandic-web/types/components/hotelReservation/enterDetails/priceChangeDialog.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type PriceChangeDialogProps = { - isOpen: boolean - oldPrice: number - newPrice: number - currency: string - onCancel: () => void - onAccept: () => void -}