diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx deleted file mode 100644 index fc68de76e..000000000 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -"use client" - -import { useRef } from "react" - -import Header from "@/components/HotelReservation/BookingConfirmation/Header" - -import styles from "./confirmation.module.css" - -import type { ConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" - -export default function Confirmation({ - booking, - hotel, - children, -}: React.PropsWithChildren) { - const mainRef = useRef(null) - - return ( -
-
- {children} -
- ) -} diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/index.tsx index ff3a20bff..676f7bd3c 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/index.tsx @@ -10,8 +10,9 @@ import Promo from "./Promo" import styles from "./promos.module.css" +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" + import type { PromosProps } from "@/types/components/hotelReservation/bookingConfirmation/promos" -import type { AdditionalInfoCookieValue } from "../../FindMyBooking/AdditionalInfoForm" export default function Promos({ booking }: PromosProps) { const intl = useIntl() diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx index 8baa14eff..6fc76589c 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/index.tsx @@ -1,5 +1,6 @@ import { notFound } from "next/navigation" +import { Confirmation } from "@scandic-hotels/booking-flow/components/BookingConfirmation/Confirmation" import BookingConfirmationProvider from "@scandic-hotels/booking-flow/providers/BookingConfirmationProvider" import { filterOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate" import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert" @@ -17,13 +18,15 @@ import Rooms from "@/components/HotelReservation/BookingConfirmation/Rooms" import SidePanel from "@/components/HotelReservation/SidePanel" import { getIntl } from "@/i18n" -import Confirmation from "./Confirmation" import Tracking from "./Tracking" import { mapRoomState } from "./utils" import styles from "./bookingConfirmation.module.css" -import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" +type BookingConfirmationProps = { + refId: string + membershipFailedError: boolean +} export default async function BookingConfirmation({ refId, diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/utils.ts b/apps/scandic-web/components/HotelReservation/BookingConfirmation/utils.ts index c5ea2ab5d..4e42dfec3 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/utils.ts +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/utils.ts @@ -4,13 +4,12 @@ import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast" +import type { BookingConfirmationRoom } from "@scandic-hotels/booking-flow/types/components/bookingConfirmation/bookingConfirmation" import type { BookingConfirmationSchema, PackageSchema, } from "@scandic-hotels/trpc/types/bookingConfirmation" -import type { BookingConfirmationRoom } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" - export function mapRoomState( booking: BookingConfirmationSchema, room: BookingConfirmationRoom, diff --git a/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx b/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx index 067cb2621..ebc76979d 100644 --- a/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx +++ b/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx @@ -18,12 +18,7 @@ import { import styles from "./findMyBooking.module.css" -export type AdditionalInfoCookieValue = { - firstName: string - email: string - confirmationNumber: string - lastName: string -} +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" export default function AdditionalInfoForm({ confirmationNumber, diff --git a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx index 7217315fe..236b03ebc 100644 --- a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx +++ b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx @@ -24,7 +24,7 @@ import { type FindMyBookingFormSchema, findMyBookingFormSchema } from "./schema" import styles from "./findMyBooking.module.css" -import type { AdditionalInfoCookieValue } from "./AdditionalInfoForm" +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" export default function FindMyBooking() { const router = useRouter() diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx index 0a07a51fa..6b605f62b 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx @@ -15,9 +15,7 @@ import { getProfileSafely, } from "@/lib/trpc/memoizedRequests" -import AdditionalInfoForm, { - type AdditionalInfoCookieValue, -} from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm" +import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm" import { getIntl } from "@/i18n" import { isLoggedInUser } from "@/utils/isLoggedInUser" @@ -33,6 +31,7 @@ import Tracking from "./tracking" import styles from "./receipt.module.css" +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" export async function Receipt({ refId }: { refId: string }) { diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/AddToCalendar/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/AddToCalendar/index.tsx index 12145b734..59ce6bd5d 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/AddToCalendar/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/AddToCalendar/index.tsx @@ -2,12 +2,12 @@ import { usePathname } from "next/navigation" +import { AddToCalendar } from "@scandic-hotels/booking-flow/components/AddToCalendar" +import { generateDateTime } from "@scandic-hotels/booking-flow/components/BookingConfirmation/Header/Actions/helpers" + import { isWebview } from "@/constants/routes/webviews" import { useMyStayStore } from "@/stores/my-stay" -import AddToCalendar from "@/components/HotelReservation/AddToCalendar" -import { generateDateTime } from "@/components/HotelReservation/BookingConfirmation/Header/Actions/helpers" - import { dateHasPassed } from "../utils" import AddToCalendarButton from "./AddToCalendarButton" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.test.ts b/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.test.ts index 8e93bdcbb..3b81ddb8a 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.test.ts +++ b/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.test.ts @@ -7,10 +7,10 @@ import accessBooking, { ERROR_UNAUTHORIZED, } from "./accessBooking" +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" import type { Guest } from "@scandic-hotels/trpc/routers/booking/output" import type { SafeUser } from "@/types/user" -import type { AdditionalInfoCookieValue } from "../FindMyBooking/AdditionalInfoForm" describe("Access booking", () => { describe("for logged in booking", () => { diff --git a/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.ts b/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.ts index 75371f11b..94136c6b9 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.ts +++ b/apps/scandic-web/components/HotelReservation/MyStay/accessBooking.ts @@ -1,7 +1,7 @@ +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" import type { Guest } from "@scandic-hotels/trpc/routers/booking/output" import type { SafeUser } from "@/types/user" -import type { AdditionalInfoCookieValue } from "../FindMyBooking/AdditionalInfoForm" export { ACCESS_GRANTED, diff --git a/apps/scandic-web/components/HotelReservation/MyStay/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/index.tsx index b727d1b67..e7353a323 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/index.tsx @@ -21,9 +21,7 @@ import { getSavedPaymentCardsSafely, } from "@/lib/trpc/memoizedRequests" -import AdditionalInfoForm, { - type AdditionalInfoCookieValue, -} from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm" +import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm" import accessBooking, { ACCESS_GRANTED, ERROR_BAD_REQUEST, @@ -42,6 +40,7 @@ import { isLoggedInUser } from "@/utils/isLoggedInUser" import styles from "./index.module.css" +import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue" import type { Lang } from "@scandic-hotels/common/constants/language" import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" diff --git a/apps/scandic-web/package.json b/apps/scandic-web/package.json index ec9fe6509..431a67d77 100644 --- a/apps/scandic-web/package.json +++ b/apps/scandic-web/package.json @@ -93,7 +93,6 @@ "react-hook-form": "^7.56.2", "react-international-phone": "^4.5.0", "react-intl": "^7.1.11", - "react-to-print": "^3.1.0", "server-only": "^0.0.1", "supercluster": "^8.0.1", "usehooks-ts": "3.1.1", diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/addToCalendar.ts b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/addToCalendar.ts deleted file mode 100644 index 789cabc76..000000000 --- a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/addToCalendar.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { RouterOutput } from "@scandic-hotels/trpc/client" -import type { EventAttributes } from "ics" - -export interface AddToCalendarProps { - checkInDate: NonNullable< - RouterOutput["booking"]["get"] - >["booking"]["checkInDate"] - event: EventAttributes - hotelName: NonNullable["hotel"]["name"] - renderButton: (onPress: () => Promise) => React.ReactNode -} diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/manageBooking.ts b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/manageBooking.ts deleted file mode 100644 index de67dae78..000000000 --- a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/manageBooking.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" - -export interface ManageBookingProps - extends Pick {} diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/bookingConfirmation.ts b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/bookingConfirmation.ts deleted file mode 100644 index 74868e909..000000000 --- a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/bookingConfirmation.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { - BookingConfirmation, - BookingConfirmationSchema, -} from "@scandic-hotels/trpc/types/bookingConfirmation" -import type { Room } from "@scandic-hotels/trpc/types/hotel" - -export interface BookingConfirmationProps { - refId: string - membershipFailedError: boolean -} - -export interface BookingConfirmationRoom extends Room { - bedType: Room["roomTypes"][number] -} - -export interface ConfirmationProps - extends Pick { - room: BookingConfirmationRoom -} - -export interface BookingConfirmationAlertsProps { - booking: BookingConfirmationSchema -} diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/header.ts b/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/header.ts deleted file mode 100644 index 34cb5ab13..000000000 --- a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/header.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" -import type { MutableRefObject } from "react" - -export interface BookingConfirmationHeaderProps - extends Pick { - mainRef: MutableRefObject -} diff --git a/apps/scandic-web/components/HotelReservation/AddToCalendar/index.tsx b/packages/booking-flow/lib/components/AddToCalendar/index.tsx similarity index 74% rename from apps/scandic-web/components/HotelReservation/AddToCalendar/index.tsx rename to packages/booking-flow/lib/components/AddToCalendar/index.tsx index 4f6c6c19d..667e7254d 100644 --- a/apps/scandic-web/components/HotelReservation/AddToCalendar/index.tsx +++ b/packages/booking-flow/lib/components/AddToCalendar/index.tsx @@ -1,16 +1,25 @@ "use client" -import { createEvent } from "ics" +import { createEvent, type EventAttributes } from "ics" import { useIntl } from "react-intl" import { dt } from "@scandic-hotels/common/dt" import { logger } from "@scandic-hotels/common/logger" import { toast } from "@scandic-hotels/design-system/Toast" -import useLang from "@/hooks/useLang" +import useLang from "../../hooks/useLang" -import type { AddToCalendarProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/addToCalendar" +import type { RouterOutput } from "@scandic-hotels/trpc/client" -export default function AddToCalendar({ +type AddToCalendarProps = { + checkInDate: NonNullable< + RouterOutput["booking"]["get"] + >["booking"]["checkInDate"] + event: EventAttributes + hotelName: NonNullable["hotel"]["name"] + renderButton: (onPress: () => Promise) => React.ReactNode +} + +export function AddToCalendar({ checkInDate, event, hotelName, diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/confirmation.module.css b/packages/booking-flow/lib/components/BookingConfirmation/Confirmation/confirmation.module.css similarity index 100% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/confirmation.module.css rename to packages/booking-flow/lib/components/BookingConfirmation/Confirmation/confirmation.module.css diff --git a/packages/booking-flow/lib/components/BookingConfirmation/Confirmation/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Confirmation/index.tsx new file mode 100644 index 000000000..e897970ab --- /dev/null +++ b/packages/booking-flow/lib/components/BookingConfirmation/Confirmation/index.tsx @@ -0,0 +1,31 @@ +"use client" + +import { useRef } from "react" + +import { Header } from "../Header" + +import styles from "./confirmation.module.css" + +import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" + +import type { BookingConfirmationRoom } from "../../../types/components/bookingConfirmation/bookingConfirmation" + +interface ConfirmationProps + extends Pick { + room: BookingConfirmationRoom +} + +export function Confirmation({ + booking, + hotel, + children, +}: React.PropsWithChildren) { + const mainRef = useRef(null) + + return ( +
+
+ {children} +
+ ) +} diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx similarity index 86% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx rename to packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx index 037de0363..f8da90af2 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/AddToCalendarButton.tsx @@ -4,11 +4,7 @@ import { useIntl } from "react-intl" import { Button } from "@scandic-hotels/design-system/Button" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" -export default function AddToCalendarButton({ - onPress, -}: { - onPress: () => void -}) { +export function AddToCalendarButton({ onPress }: { onPress: () => void }) { const intl = useIntl() return ( diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/DownloadInvoice.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/DownloadInvoice.tsx similarity index 86% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/DownloadInvoice.tsx rename to packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/DownloadInvoice.tsx index 900fa1499..001678299 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/DownloadInvoice.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/DownloadInvoice.tsx @@ -5,7 +5,7 @@ import { useReactToPrint } from "react-to-print" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton" -import type { DownloadInvoiceProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/downloadInvoice" +import type { DownloadInvoiceProps } from "../../../../types/components/bookingConfirmation/actions/downloadInvoice" export default function DownloadInvoice({ mainRef }: DownloadInvoiceProps) { const intl = useIntl() diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/ManageBooking.tsx similarity index 80% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx rename to packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/ManageBooking.tsx index cbbf00c80..114ab01ce 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/ManageBooking.tsx @@ -7,10 +7,13 @@ import { myStay } from "@scandic-hotels/common/constants/routes/myStay" import ButtonLink from "@scandic-hotels/design-system/ButtonLink" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" -import useLang from "@/hooks/useLang" +import useLang from "../../../../hooks/useLang" -import type { ManageBookingProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/manageBooking" -import type { AdditionalInfoCookieValue } from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm" +import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" + +import type { AdditionalInfoCookieValue } from "../../../../types/components/findMyBooking/additionalInfoCookieValue" + +interface ManageBookingProps extends Pick {} export default function ManageBooking({ booking }: ManageBookingProps) { const intl = useIntl() diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/helpers.ts b/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/helpers.ts similarity index 100% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/helpers.ts rename to packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/helpers.ts diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/header.module.css b/packages/booking-flow/lib/components/BookingConfirmation/Header/header.module.css similarity index 100% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/header.module.css rename to packages/booking-flow/lib/components/BookingConfirmation/Header/header.module.css diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Header/index.tsx similarity index 83% rename from apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx rename to packages/booking-flow/lib/components/BookingConfirmation/Header/index.tsx index 43b9cefd1..1a32f2d94 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Header/index.tsx @@ -5,19 +5,24 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import Title from "@scandic-hotels/design-system/Title" -import AddToCalendar from "../../AddToCalendar" -import AddToCalendarButton from "./Actions/AddToCalendarButton" +import { AddToCalendar } from "../../AddToCalendar" +import { AddToCalendarButton } from "./Actions/AddToCalendarButton" // import DownloadInvoice from "./Actions/DownloadInvoice" import { generateDateTime } from "./Actions/helpers" import ManageBooking from "./Actions/ManageBooking" import styles from "./header.module.css" +import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" import type { EventAttributes } from "ics" +import type { MutableRefObject } from "react" -import type { BookingConfirmationHeaderProps } from "@/types/components/hotelReservation/bookingConfirmation/header" +export interface BookingConfirmationHeaderProps + extends Pick { + mainRef: MutableRefObject +} -export default function Header({ +export function Header({ booking, hotel, // mainRef, diff --git a/apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/downloadInvoice.ts b/packages/booking-flow/lib/types/components/bookingConfirmation/actions/downloadInvoice.ts similarity index 100% rename from apps/scandic-web/types/components/hotelReservation/bookingConfirmation/actions/downloadInvoice.ts rename to packages/booking-flow/lib/types/components/bookingConfirmation/actions/downloadInvoice.ts diff --git a/packages/booking-flow/lib/types/components/bookingConfirmation/bookingConfirmation.ts b/packages/booking-flow/lib/types/components/bookingConfirmation/bookingConfirmation.ts new file mode 100644 index 000000000..b56e0f51f --- /dev/null +++ b/packages/booking-flow/lib/types/components/bookingConfirmation/bookingConfirmation.ts @@ -0,0 +1,5 @@ +import type { Room } from "@scandic-hotels/trpc/types/hotel" + +export interface BookingConfirmationRoom extends Room { + bedType: Room["roomTypes"][number] +} diff --git a/packages/booking-flow/lib/types/components/findMyBooking/additionalInfoCookieValue.ts b/packages/booking-flow/lib/types/components/findMyBooking/additionalInfoCookieValue.ts new file mode 100644 index 000000000..bf422562c --- /dev/null +++ b/packages/booking-flow/lib/types/components/findMyBooking/additionalInfoCookieValue.ts @@ -0,0 +1,6 @@ +export type AdditionalInfoCookieValue = { + firstName: string + email: string + confirmationNumber: string + lastName: string +} diff --git a/packages/booking-flow/package.json b/packages/booking-flow/package.json index 4604a4608..2f21e68e5 100644 --- a/packages/booking-flow/package.json +++ b/packages/booking-flow/package.json @@ -20,6 +20,10 @@ "./BookingWidget/FloatingBookingWidget": "./lib/components/BookingWidget/FloatingBookingWidget/index.tsx", "./BookingWidget/Skeleton": "./lib/components/BookingWidget/Skeleton.tsx", "./components/AdditionalAmenities": "./lib/components/AdditionalAmenities/index.tsx", + "./components/AddToCalendar": "./lib/components/AddToCalendar/index.tsx", + "./components/BookingConfirmation/Confirmation": "./lib/components/BookingConfirmation/Confirmation/index.tsx", + "./components/BookingConfirmation/Header/Actions/downloadInvoice": "./lib/components/BookingConfirmation/Header/Actions/downloadInvoice.ts", + "./components/BookingConfirmation/Header/Actions/helpers": "./lib/components/BookingConfirmation/Header/Actions/helpers.ts", "./components/Contact": "./lib/components/Contact/index.tsx", "./components/FnFNotAllowedAlert": "./lib/components/FnFNotAllowedAlert/index.tsx", "./components/HotelDetailsSidePeek": "./lib/components/HotelDetailsSidePeek/index.tsx", @@ -51,6 +55,8 @@ "./stores/hotels-map": "./lib/stores/hotels-map.ts", "./stores/booking-confirmation": "./lib/stores/booking-confirmation/index.ts", "./types/components/selectRate/selectRate": "./lib/types/components/selectRate/selectRate.ts", + "./types/components/bookingConfirmation/bookingConfirmation": "./lib/types/components/bookingConfirmation/bookingConfirmation.ts", + "./types/components/findMyBooking/additionalInfoCookieValue": "./lib/types/components/findMyBooking/additionalInfoCookieValue.ts", "./types/stores/rates": "./lib/types/stores/rates.ts", "./types/stores/booking-confirmation": "./lib/types/stores/booking-confirmation.ts", "./utils/isSameBooking": "./lib/utils/isSameBooking.ts", @@ -71,6 +77,7 @@ "dayjs": "^1.11.13", "downshift": "^9.0.9", "fast-deep-equal": "^3.1.0", + "ics": "^3.8.1", "json-stable-stringify-without-jsonify": "^1.0.1", "motion": "^12.10.0", "nuqs": "^2.4.3", @@ -78,6 +85,7 @@ "react-day-picker": "^9.6.7", "react-hook-form": "^7.56.2", "react-intl": "^7.1.11", + "react-to-print": "^3.1.0", "usehooks-ts": "3.1.1", "zustand": "^4.5.2" }, diff --git a/yarn.lock b/yarn.lock index b258edfd4..fc008c920 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6063,6 +6063,7 @@ __metadata: eslint-plugin-import: "npm:^2.31.0" eslint-plugin-simple-import-sort: "npm:^12.1.1" fast-deep-equal: "npm:^3.1.0" + ics: "npm:^3.8.1" json-stable-stringify-without-jsonify: "npm:^1.0.1" motion: "npm:^12.10.0" nuqs: "npm:^2.4.3" @@ -6070,6 +6071,7 @@ __metadata: react-day-picker: "npm:^9.6.7" react-hook-form: "npm:^7.56.2" react-intl: "npm:^7.1.11" + react-to-print: "npm:^3.1.0" typescript: "npm:5.8.3" usehooks-ts: "npm:3.1.1" vitest: "npm:^3.2.4" @@ -6366,7 +6368,6 @@ __metadata: react-hook-form: "npm:^7.56.2" react-international-phone: "npm:^4.5.0" react-intl: "npm:^7.1.11" - react-to-print: "npm:^3.1.0" schema-dts: "npm:^1.1.5" server-only: "npm:^0.0.1" start-server-and-test: "npm:^2.0.11"