diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/index.tsx index 5cce3d3f4..0bde2f589 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/index.tsx @@ -10,7 +10,6 @@ import Modal from "@/components/HotelReservation/MyStay/Modal" import { trackMyStayPageLink } from "@/utils/tracking" import ActionsButton from "../ActionsButton" -import { dateHasPassed } from "../utils" import Form from "./Form" import styles from "./guarantee.module.css" @@ -18,24 +17,11 @@ import styles from "./guarantee.module.css" export default function GuaranteeLateArrival() { const intl = useIntl() - const { checkInDate, checkInTime, guaranteeInfo, isCancelled, priceType } = - useMyStayStore((state) => ({ - checkInDate: state.bookedRoom.checkInDate, - checkInTime: state.hotel.hotelFacts.checkin.checkInTime, - guaranteeInfo: state.bookedRoom.guaranteeInfo, - isCancelled: state.bookedRoom.isCancelled, - priceType: state.bookedRoom.priceType, - })) + const { isGuaranteeable } = useMyStayStore((state) => ({ + isGuaranteeable: state.bookedRoom.isGuaranteeable, + })) - const isRewardNight = priceType === "points" - - const guaranteeable = - !guaranteeInfo && - !isCancelled && - !dateHasPassed(checkInDate, checkInTime) && - !isRewardNight - - if (!guaranteeable) { + if (!isGuaranteeable) { return null } diff --git a/packages/trpc/lib/routers/booking/output.ts b/packages/trpc/lib/routers/booking/output.ts index fa09920a4..bb4597bc2 100644 --- a/packages/trpc/lib/routers/booking/output.ts +++ b/packages/trpc/lib/routers/booking/output.ts @@ -230,6 +230,7 @@ export const bookingConfirmationSchema = z ) && data.attributes.reservationStatus !== BookingStatusEnum.Cancelled, isCancelable: !!data.links.cancel, isModifiable: !!data.links.modify, + isGuaranteeable: !!data.links.guarantee, canModifyAncillaries: !!data.links.addAncillary, // Typo from API cancellationNumber: data.attributes.cancelationNumber,