From 74a5b5748af2ad9f157dfd2d366a1e62c3f8f2aa Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 8 May 2025 10:46:05 +0000 Subject: [PATCH] Merged in fix/SW-2642-select-hotel-corporate-ch (pull request #2003) fix: SW-2642 Fixed corporate chq and voucher rates city search * fix: SW-2642 Fixed corporate chq and voucher rates city search * fix: SW-2642 Fixed no availability alert for all hotels * fix: SW-2642 Combined flags to suitable variable * fix: SW-2642 Fixed map view to show prices Approved-by: Arvid Norlin --- .../bookingCodeChip.module.css | 2 +- .../components/BookingCodeChip/index.tsx | 16 ++--- .../HotelCard/HotelChequeCard/index.tsx | 7 +- .../HotelReservation/HotelCard/index.tsx | 4 +- .../ListingHotelCardDialog/index.tsx | 67 ++++++++++++++++++- .../StandaloneHotelCardDialog/index.tsx | 65 +++++++++++++++++- .../HotelCardDialogListing/utils.ts | 10 ++- .../HotelCardListing/index.tsx | 12 +--- .../HotelCardListing/utils.ts | 8 +-- .../SelectHotelMapContainer.tsx | 6 +- .../SelectHotelMapContent/index.tsx | 20 ++++-- .../HotelReservation/SelectHotel/index.tsx | 8 +-- .../RoomsList/RoomListItem/Rates/Code.tsx | 21 +++++- .../HotelListingMapContent/HotelPin/index.tsx | 18 ++++- .../HotelListingMapContent/index.tsx | 16 ++++- .../server/routers/hotels/output.ts | 28 +++----- .../hotels/schemas/productTypePrice.ts | 1 - .../hotelReservation/selectHotel/map.ts | 3 + 18 files changed, 232 insertions(+), 80 deletions(-) diff --git a/apps/scandic-web/components/BookingCodeChip/bookingCodeChip.module.css b/apps/scandic-web/components/BookingCodeChip/bookingCodeChip.module.css index 5d439bbfa..97e4fd9a2 100644 --- a/apps/scandic-web/components/BookingCodeChip/bookingCodeChip.module.css +++ b/apps/scandic-web/components/BookingCodeChip/bookingCodeChip.module.css @@ -3,7 +3,7 @@ gap: var(--Space-x05); } -.bookingCodeChip .unavailable { +.unavailable { text-decoration: line-through; } diff --git a/apps/scandic-web/components/BookingCodeChip/index.tsx b/apps/scandic-web/components/BookingCodeChip/index.tsx index e76d61fcd..9c5813b2f 100644 --- a/apps/scandic-web/components/BookingCodeChip/index.tsx +++ b/apps/scandic-web/components/BookingCodeChip/index.tsx @@ -65,24 +65,16 @@ export default function BookingCodeChip({ icon={} className={alignCenter ? styles.center : undefined} > -

+

{intl.formatMessage({ defaultMessage: "Booking code" })} - - {isUnavailable - ? intl.formatMessage( - { defaultMessage: "{code} unavailable" }, - { code: bookingCode } - ) - : intl.formatMessage( - { defaultMessage: "{code} applied" }, - { code: bookingCode } - )} - + {bookingCode}

diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx index c7c81a192..c40713e1a 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx @@ -27,7 +27,7 @@ export default function HotelChequeCard({ {productTypeCheque.localPrice.numberOfCheques} {CurrencyEnum.CC} - {productTypeCheque.localPrice.additionalPricePerStay && ( + {productTypeCheque.localPrice.additionalPricePerStay > 0 ? ( <> {"+"} @@ -37,10 +37,11 @@ export default function HotelChequeCard({ {productTypeCheque.localPrice.currency} - )} + ) : null} - {productTypeCheque.requestedPrice ? ( + {productTypeCheque.requestedPrice && + productTypeCheque.requestedPrice.additionalPricePerStay > 0 ? (
{intl.formatMessage({ diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx index ec2933243..f525626ba 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx @@ -69,9 +69,7 @@ function HotelCard({ const addressStr = `${hotel.address.streetAddress}, ${hotel.address.city}` const galleryImages = mapApiImagesToGalleryImages(hotel.galleryImages || []) - const fullPrice = - !availability.productType?.public?.bookingCode && - !availability.productType?.member?.bookingCode + const fullPrice = !availability.bookingCode const price = availability.productType const hasInsufficientPoints = !price?.redemptions?.some( diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx index db216eb16..85d5cfe98 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx @@ -2,6 +2,8 @@ import { useSession } from "next-auth/react" import { useIntl } from "react-intl" +import { Typography } from "@scandic-hotels/design-system/Typography" + import { selectRate } from "@/constants/routes/hotelReservation" import { FacilityToIcon } from "@/components/ContentType/HotelPage/data" @@ -47,6 +49,8 @@ export default function ListingHotelCardDialog({ ratings, operaId, redemptionPrice, + chequePrice, + voucherPrice, } = data const firstImage = images[0]?.imageSizes?.small @@ -81,7 +85,11 @@ export default function ListingHotelCardDialog({
- {publicPrice || memberPrice || redemptionPrice ? ( + {publicPrice || + memberPrice || + redemptionPrice || + voucherPrice || + chequePrice ? (
{redemptionPrice ? ( @@ -130,6 +138,63 @@ export default function ListingHotelCardDialog({ {redemptionPrice && ( )} + {chequePrice && ( + + {intl.formatMessage( + { + defaultMessage: "{price} {currency}", + }, + { + price: chequePrice.numberOfCheques, + currency: "CC", + } + )} + {chequePrice.additionalPricePerStay > 0 + ? // eslint-disable-next-line formatjs/no-literal-string-in-jsx + " + " + + intl.formatMessage( + { + defaultMessage: "{price} {currency}", + }, + { + price: chequePrice.additionalPricePerStay, + currency: chequePrice.currency, + } + ) + : null} + + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} + + / + {intl.formatMessage({ + defaultMessage: "night", + })} + + + + )} + {voucherPrice && ( + + {intl.formatMessage( + { + defaultMessage: "{price} {currency}", + }, + { + price: voucherPrice, + currency, + } + )} + + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} + + / + {intl.formatMessage({ + defaultMessage: "night", + })} + + + + )}