From b0f2276b0b20420b3e3d53934d7f68a356ca37dd Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Thu, 13 Nov 2025 14:32:17 +0000 Subject: [PATCH] fix(BOOK-559): Using same ContactInformation component on hotel pages and booking flow inside the hotel details sidepeek Approved-by: Bianca Widstam --- .../destinations/[country]/[city]/route.ts | 2 +- .../api/web/destinations/[country]/route.ts | 2 +- .../HotelPage/IntroSection/index.tsx | 4 +- .../SidePeeks/AboutTheHotel/index.tsx | 3 +- .../HotelSubpage/Sidebar/MeetingsSidebar.tsx | 2 +- .../HotelSubpage/Sidebar/ParkingSidebar.tsx | 2 +- .../Sidebar/RestaurantSidebar.tsx | 2 +- .../HotelSubpage/Sidebar/WellnessSidebar.tsx | 2 +- .../lib/trpc/memoizedRequests/index.ts | 2 +- .../hotelPage/sidepeek/aboutTheHotel.ts | 5 - .../lib/components/Contact/contact.module.css | 61 ------- .../lib/components/Contact/index.tsx | 159 ------------------ .../contactInformation.module.css | 0 .../ContactInformation/index.tsx | 24 ++- .../hotelSidePeek.module.css | 2 +- .../HotelSidePeekContent/index.tsx | 18 +- packages/booking-flow/package.json | 1 + packages/common/constants/country.ts | 8 + packages/common/package.json | 1 + .../components/LocalCallCharges/index.tsx | 16 +- packages/design-system/package.json | 1 + .../lib/routers/autocomplete/destinations.ts | 4 +- .../destinationCountryPage/input.ts | 2 +- .../destinationCountryPage/output.ts | 2 +- .../destinationCountryPage/utils.ts | 3 +- .../destinationOverviewPage/query.ts | 4 +- .../destinationOverviewPage/utils.ts | 3 +- .../routers/contentstack/metadata/output.ts | 2 +- .../schemas/blocks/hotelListing.ts | 3 +- packages/trpc/lib/routers/hotels/input.ts | 2 +- .../services/getLocationsByCountries.ts | 3 +- packages/trpc/lib/types/country.ts | 10 +- packages/trpc/lib/types/locations.ts | 2 +- 33 files changed, 75 insertions(+), 282 deletions(-) delete mode 100644 packages/booking-flow/lib/components/Contact/contact.module.css delete mode 100644 packages/booking-flow/lib/components/Contact/index.tsx rename {apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel => packages/booking-flow/lib/components/HotelDetailsSidePeek}/ContactInformation/contactInformation.module.css (100%) rename {apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel => packages/booking-flow/lib/components/HotelDetailsSidePeek}/ContactInformation/index.tsx (89%) create mode 100644 packages/common/constants/country.ts rename {apps/scandic-web => packages/design-system/lib}/components/LocalCallCharges/index.tsx (50%) diff --git a/apps/scandic-web/app/api/web/destinations/[country]/[city]/route.ts b/apps/scandic-web/app/api/web/destinations/[country]/[city]/route.ts index 6b034e45a..f8fd873b2 100644 --- a/apps/scandic-web/app/api/web/destinations/[country]/[city]/route.ts +++ b/apps/scandic-web/app/api/web/destinations/[country]/[city]/route.ts @@ -3,6 +3,7 @@ import { TRPCError } from "@trpc/server" import { unstable_noStore as noStore } from "next/cache" import { NextResponse } from "next/server" +import { Country } from "@scandic-hotels/common/constants/country" import { Lang } from "@scandic-hotels/common/constants/language" import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals" import { @@ -10,7 +11,6 @@ import { httpStatusByErrorCode, notFound, } from "@scandic-hotels/trpc/errors" -import { Country } from "@scandic-hotels/trpc/types/country" import { isCityLocation, isHotelLocation, diff --git a/apps/scandic-web/app/api/web/destinations/[country]/route.ts b/apps/scandic-web/app/api/web/destinations/[country]/route.ts index 14c574d62..66e750236 100644 --- a/apps/scandic-web/app/api/web/destinations/[country]/route.ts +++ b/apps/scandic-web/app/api/web/destinations/[country]/route.ts @@ -3,6 +3,7 @@ import { TRPCError } from "@trpc/server" import { unstable_noStore as noStore } from "next/cache" import { NextResponse } from "next/server" +import { Country } from "@scandic-hotels/common/constants/country" import { Lang } from "@scandic-hotels/common/constants/language" import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals" import { @@ -10,7 +11,6 @@ import { httpStatusByErrorCode, notFound, } from "@scandic-hotels/trpc/errors" -import { Country } from "@scandic-hotels/trpc/types/country" import { isCityLocation, isHotelLocation, diff --git a/apps/scandic-web/components/ContentType/HotelPage/IntroSection/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/IntroSection/index.tsx index 00b2e1842..5c4cfe6b6 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/IntroSection/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/IntroSection/index.tsx @@ -1,14 +1,14 @@ import { cx } from "class-variance-authority" +import { Country } from "@scandic-hotels/common/constants/country" import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting" import ButtonLink from "@scandic-hotels/design-system/ButtonLink" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import { TextLink } from "@scandic-hotels/design-system/TextLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import { Country } from "@scandic-hotels/trpc/types/country" -import LocalCallCharges from "@/components/LocalCallCharges" import { getIntl } from "@/i18n" import TripAdvisorSection from "./TripAdvisorSection" diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/index.tsx index 1ad7d864a..6bfb9287b 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/index.tsx @@ -1,11 +1,10 @@ +import { ContactInformation } from "@scandic-hotels/booking-flow/components/HotelDetails/ContactInformation" import { Divider } from "@scandic-hotels/design-system/Divider" import SidePeek from "@scandic-hotels/design-system/SidePeek" import { Typography } from "@scandic-hotels/design-system/Typography" import { getIntl } from "@/i18n" -import ContactInformation from "./ContactInformation" - import styles from "./aboutTheHotel.module.css" import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage" diff --git a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/MeetingsSidebar.tsx b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/MeetingsSidebar.tsx index fd3b3c8e4..bbc12ced1 100644 --- a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/MeetingsSidebar.tsx +++ b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/MeetingsSidebar.tsx @@ -1,7 +1,7 @@ +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import { TextLink } from "@scandic-hotels/design-system/TextLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import LocalCallCharges from "@/components/LocalCallCharges" import { getIntl } from "@/i18n" import styles from "./sidebar.module.css" diff --git a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/ParkingSidebar.tsx b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/ParkingSidebar.tsx index 2cc2e635c..c23f40a15 100644 --- a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/ParkingSidebar.tsx +++ b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/ParkingSidebar.tsx @@ -1,7 +1,7 @@ +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import { TextLink } from "@scandic-hotels/design-system/TextLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import LocalCallCharges from "@/components/LocalCallCharges" import { getIntl } from "@/i18n" import styles from "./sidebar.module.css" diff --git a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/RestaurantSidebar.tsx b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/RestaurantSidebar.tsx index 813533f67..eca77143d 100644 --- a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/RestaurantSidebar.tsx +++ b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/RestaurantSidebar.tsx @@ -1,10 +1,10 @@ import ButtonLink from "@scandic-hotels/design-system/ButtonLink" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import OpeningHours from "@scandic-hotels/design-system/OpeningHours" import { TextLink } from "@scandic-hotels/design-system/TextLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import LocalCallCharges from "@/components/LocalCallCharges" import { getIntl } from "@/i18n" import styles from "./sidebar.module.css" diff --git a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/WellnessSidebar.tsx b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/WellnessSidebar.tsx index 80bd6d69e..5f092d3d4 100644 --- a/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/WellnessSidebar.tsx +++ b/apps/scandic-web/components/ContentType/HotelSubpage/Sidebar/WellnessSidebar.tsx @@ -1,7 +1,7 @@ +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import Link from "@scandic-hotels/design-system/OldDSLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import LocalCallCharges from "@/components/LocalCallCharges" import { getIntl } from "@/i18n" import OpeningHours from "../../HotelPage/SidePeeks/WellnessAndExercise/Facility/OpeningHours" diff --git a/apps/scandic-web/lib/trpc/memoizedRequests/index.ts b/apps/scandic-web/lib/trpc/memoizedRequests/index.ts index 114346e2a..f480811e6 100644 --- a/apps/scandic-web/lib/trpc/memoizedRequests/index.ts +++ b/apps/scandic-web/lib/trpc/memoizedRequests/index.ts @@ -2,10 +2,10 @@ import { cache } from "@/utils/cache" import { serverClient } from "../server" +import type { Country } from "@scandic-hotels/common/constants/country" import type { Lang } from "@scandic-hotels/common/constants/language" import type { GetHotelsByCSFilterInput } from "@scandic-hotels/trpc/routers/hotels/input" import type { GetSavedPaymentCardsInput } from "@scandic-hotels/trpc/routers/user/input" -import type { Country } from "@scandic-hotels/trpc/types/country" import type { HotelInput } from "@scandic-hotels/trpc/types/hotel" import type { AncillaryPackagesInput, diff --git a/apps/scandic-web/types/components/hotelPage/sidepeek/aboutTheHotel.ts b/apps/scandic-web/types/components/hotelPage/sidepeek/aboutTheHotel.ts index 6da1777fb..19842f909 100644 --- a/apps/scandic-web/types/components/hotelPage/sidepeek/aboutTheHotel.ts +++ b/apps/scandic-web/types/components/hotelPage/sidepeek/aboutTheHotel.ts @@ -8,8 +8,3 @@ export type AboutTheHotelSidePeekProps = { descriptions: Hotel["hotelContent"]["texts"] hotelName: Hotel["name"] } - -export type ContactInformationProps = Omit< - AboutTheHotelSidePeekProps, - "descriptions" -> diff --git a/packages/booking-flow/lib/components/Contact/contact.module.css b/packages/booking-flow/lib/components/Contact/contact.module.css deleted file mode 100644 index c1de3ddb1..000000000 --- a/packages/booking-flow/lib/components/Contact/contact.module.css +++ /dev/null @@ -1,61 +0,0 @@ -.wrapper { - display: grid; - grid-template-columns: 1fr 1fr; - grid-template-rows: auto; - gap: var(--Space-x2); - font-family: var(--typography-Body-Regular-fontFamily); - margin-bottom: var(--Space-x3); -} - -.address, -.contactInfo { - display: grid; - grid-template-columns: subgrid; - grid-template-rows: subgrid; - grid-column: 1 / 3; - grid-row: 1 / 4; -} - -.contactInfo > li { - font-style: normal; - list-style-type: none; - display: flex; - flex-direction: column; - min-width: 0; -} - -.soMeIcons { - display: flex; - gap: var(--Space-x15); -} - -.ecoLabel { - width: 38px; - height: auto; -} - -.ecoLabel img { - width: 100%; - height: auto; - flex-shrink: 0; - grid-column: 1 / 3; - grid-row: 4 / 4; -} - -.ecoContainer { - display: flex; - align-items: center; - column-gap: var(--Space-x15); - grid-column: 1 / 3; - grid-row: 4 / 4; - font-size: var(--typography-Footnote-Regular-fontSize); - line-height: (); - margin-bottom: var(--Space-x1); -} - -.ecoLabelText { - display: flex; - color: var(--UI-Text-Medium-contrast); - flex-direction: column; - justify-content: center; -} diff --git a/packages/booking-flow/lib/components/Contact/index.tsx b/packages/booking-flow/lib/components/Contact/index.tsx deleted file mode 100644 index cc9ef6526..000000000 --- a/packages/booking-flow/lib/components/Contact/index.tsx +++ /dev/null @@ -1,159 +0,0 @@ -"use client" - -import { useIntl } from "react-intl" - -import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon" -import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon" -import Image from "@scandic-hotels/design-system/Image" -import Link from "@scandic-hotels/design-system/OldDSLink" -import { Typography } from "@scandic-hotels/design-system/Typography" - -import useLang from "../../hooks/useLang" - -import styles from "./contact.module.css" - -import type { Hotel } from "@scandic-hotels/trpc/types/hotel" - -interface ContactProps { - hotel: Hotel -} - -export default function Contact({ hotel }: ContactProps) { - const lang = useLang() - const intl = useIntl() - - const addressStr = `${hotel.address.streetAddress}, ` - const cityStr = hotel.address.city - - return ( -
-
-
    -
  • - -

    - {intl.formatMessage({ - id: "common.address", - defaultMessage: "Address", - })} -

    -
    - -

    - {addressStr} -
    - {cityStr} -

    -
    -
  • -
  • - -

    - {intl.formatMessage({ - id: "common.drivingDirections", - defaultMessage: "Driving directions", - })} -

    -
    - - -

    - {intl.formatMessage({ - id: "common.googleMaps", - defaultMessage: "Google Maps", - })} -

    -
    - -
  • -
  • - -

    - {intl.formatMessage({ - id: "common.contactUs", - defaultMessage: "Contact us", - })} -

    -
    - - -

    {hotel.contactInformation.phoneNumber}

    -
    - -
  • -
  • - {(hotel.socialMedia.facebook || hotel.socialMedia.instagram) && ( - <> - -

    - {intl.formatMessage({ - id: "common.followUs", - defaultMessage: "Follow us", - })} -

    -
    -
    - {hotel.socialMedia.instagram && ( - - - - )} - {hotel.socialMedia.facebook && ( - - - - )} -
    - - )} -
  • -
  • - -

    - {intl.formatMessage({ - id: "common.email", - defaultMessage: "Email", - })} -

    -
    - - -

    {hotel.contactInformation.email}

    -
    - -
  • -
-
- {hotel.hotelFacts.ecoLabels?.nordicEcoLabel ? ( -
-
- {intl.formatMessage({ -
-
- - {intl.formatMessage({ - id: "common.nordicSwanEcolabel", - defaultMessage: "Nordic Swan Ecolabel", - })} - - - {hotel.hotelFacts.ecoLabels.svanenEcoLabelCertificateNumber} - -
-
- ) : null} -
- ) -} diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/contactInformation.module.css b/packages/booking-flow/lib/components/HotelDetailsSidePeek/ContactInformation/contactInformation.module.css similarity index 100% rename from apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/contactInformation.module.css rename to packages/booking-flow/lib/components/HotelDetailsSidePeek/ContactInformation/contactInformation.module.css diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx b/packages/booking-flow/lib/components/HotelDetailsSidePeek/ContactInformation/index.tsx similarity index 89% rename from apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx rename to packages/booking-flow/lib/components/HotelDetailsSidePeek/ContactInformation/index.tsx index f241ffaad..b07b79043 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx +++ b/packages/booking-flow/lib/components/HotelDetailsSidePeek/ContactInformation/index.tsx @@ -1,28 +1,38 @@ +"use client" + import NextLink from "next/link" +import { useIntl } from "react-intl" import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon" import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon" import Image from "@scandic-hotels/design-system/Image" +import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges" import { TextLink } from "@scandic-hotels/design-system/TextLink" import { Typography } from "@scandic-hotels/design-system/Typography" -import LocalCallCharges from "@/components/LocalCallCharges" -import { getIntl } from "@/i18n" -import { getLang } from "@/i18n/serverContext" +import useLang from "../../../hooks/useLang" import styles from "./contactInformation.module.css" -import type { ContactInformationProps } from "@/types/components/hotelPage/sidepeek/aboutTheHotel" +import type { Hotel, HotelAddress } from "@scandic-hotels/trpc/types/hotel" -export default async function ContactInformation({ +interface ContactInformationProps { + hotelAddress: HotelAddress + contact: Hotel["contactInformation"] + socials: Hotel["socialMedia"] + ecoLabels: Hotel["hotelFacts"]["ecoLabels"] + hotelName: Hotel["name"] +} + +export function ContactInformation({ hotelAddress, contact, socials, ecoLabels, hotelName, }: ContactInformationProps) { - const intl = await getIntl() - const lang = await getLang() + const intl = useIntl() + const lang = useLang() const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent( `${hotelName}, ${hotelAddress.streetAddress}, ${hotelAddress.zipCode} ${hotelAddress.city}` )}` diff --git a/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/hotelSidePeek.module.css b/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/hotelSidePeek.module.css index cbcce98f4..dbd422951 100644 --- a/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/hotelSidePeek.module.css +++ b/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/hotelSidePeek.module.css @@ -1,5 +1,5 @@ .content { display: grid; - gap: var(--Space-x2); + gap: var(--Space-x4); color: var(--Text-Default); } diff --git a/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/index.tsx b/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/index.tsx index a9c05602e..92e982404 100644 --- a/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/index.tsx +++ b/packages/booking-flow/lib/components/HotelDetailsSidePeek/HotelSidePeekContent/index.tsx @@ -10,10 +10,10 @@ import { trackAccordionClick } from "@scandic-hotels/tracking/componentEvents" import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext" import { routeToScandicWebUrl } from "../../../utils/routeToScandicWebUrl" import AdditionalAmenities from "../../AdditionalAmenities" -import Contact from "../../Contact" import BreakfastAccordionItem from "../../SidePeekAccordions/BreakfastAccordionItem" import CheckInCheckOutAccordionItem from "../../SidePeekAccordions/CheckInCheckOutAccordionItem" import ParkingAccordionItem from "../../SidePeekAccordions/ParkingAccordionItem" +import { ContactInformation } from "../ContactInformation" import styles from "./hotelSidePeek.module.css" @@ -41,15 +41,13 @@ export function HotelSidePeekContent({ return (
- -

- {intl.formatMessage({ - id: "common.practicalInformation", - defaultMessage: "Practical information", - })} -

-
- +

{intl.formatMessage({ - id: "common.localCallCharges", - defaultMessage: "Price: €0.16/min + local call charges", + id: 'common.localCallCharges', + defaultMessage: 'Price: €0.16/min + local call charges', })}

diff --git a/packages/design-system/package.json b/packages/design-system/package.json index cebe4a963..44a65e100 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -141,6 +141,7 @@ "./Lightbox": "./lib/components/Lightbox/index.tsx", "./Link": "./lib/components/Link/index.tsx", "./LoadingSpinner": "./lib/components/LoadingSpinner/index.tsx", + "./LocalCallCharges": "./lib/components/LocalCallCharges/index.tsx", "./LoginButton": "./lib/components/LoginButton/index.tsx", "./Map/InfoWindow": "./lib/components/Map/InfoWindow/index.tsx", "./Map/InteractiveMap": "./lib/components/Map/InteractiveMap/index.tsx", diff --git a/packages/trpc/lib/routers/autocomplete/destinations.ts b/packages/trpc/lib/routers/autocomplete/destinations.ts index bd3924776..71edc9fd7 100644 --- a/packages/trpc/lib/routers/autocomplete/destinations.ts +++ b/packages/trpc/lib/routers/autocomplete/destinations.ts @@ -10,13 +10,15 @@ import { safeProtectedServiceProcedure } from "../../procedures" import { getCityPageUrls } from "../../routers/contentstack/destinationCityPage/utils" import { getCountryPageUrls } from "../../routers/contentstack/destinationCountryPage/utils" import { getHotelPageUrls } from "../../routers/contentstack/hotelPage/utils" -import { ApiCountry, type Country } from "../../types/country" +import { ApiCountry } from "../../types/country" import { getCitiesByCountry } from "../hotels/services/getCitiesByCountry" import { getCountries } from "../hotels/services/getCountries" import { getLocationsByCountries } from "../hotels/services/getLocationsByCountries" import { filterAndCategorizeAutoComplete } from "./util/filterAndCategorizeAutoComplete" import { mapLocationToAutoCompleteLocation } from "./util/mapLocationToAutoCompleteLocation" +import type { Country } from "@scandic-hotels/common/constants/country" + import type { AutoCompleteLocation } from "./schema" const destinationsAutoCompleteInputSchema = z.object({ diff --git a/packages/trpc/lib/routers/contentstack/destinationCountryPage/input.ts b/packages/trpc/lib/routers/contentstack/destinationCountryPage/input.ts index e01850d0e..e337c4b77 100644 --- a/packages/trpc/lib/routers/contentstack/destinationCountryPage/input.ts +++ b/packages/trpc/lib/routers/contentstack/destinationCountryPage/input.ts @@ -1,6 +1,6 @@ import { z } from "zod" -import { Country } from "../../../types/country" +import { Country } from "@scandic-hotels/common/constants/country" export const getCityPagesInput = z.object({ country: z.nativeEnum(Country), diff --git a/packages/trpc/lib/routers/contentstack/destinationCountryPage/output.ts b/packages/trpc/lib/routers/contentstack/destinationCountryPage/output.ts index 11f903c58..f6b0b2d66 100644 --- a/packages/trpc/lib/routers/contentstack/destinationCountryPage/output.ts +++ b/packages/trpc/lib/routers/contentstack/destinationCountryPage/output.ts @@ -1,9 +1,9 @@ import { z } from "zod" +import { Country } from "@scandic-hotels/common/constants/country" import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault" import { removeMultipleSlashes } from "@scandic-hotels/common/utils/url" -import { Country } from "../../../types/country" import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage" import { discriminatedUnionArray } from "../../../utils/discriminatedUnion" import { diff --git a/packages/trpc/lib/routers/contentstack/destinationCountryPage/utils.ts b/packages/trpc/lib/routers/contentstack/destinationCountryPage/utils.ts index 2e1025e85..7dd9abff6 100644 --- a/packages/trpc/lib/routers/contentstack/destinationCountryPage/utils.ts +++ b/packages/trpc/lib/routers/contentstack/destinationCountryPage/utils.ts @@ -3,13 +3,14 @@ import { createCounter } from "@scandic-hotels/common/telemetry" import { GetDestinationCityListData } from "../../../graphql/Query/DestinationCityPage/DestinationCityListData.graphql" import { GetCountryPageUrls } from "../../../graphql/Query/DestinationCountryPage/DestinationCountryPageUrl.graphql" import { request } from "../../../graphql/request" -import { ApiCountry, type Country } from "../../../types/country" +import { ApiCountry } from "../../../types/country" import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage" import { generateTag, generateTagsFromSystem } from "../../../utils/generateTag" import { getCitiesByCountry } from "../../hotels/services/getCitiesByCountry" import { destinationCityListDataSchema } from "../destinationCityPage/output" import { countryPageUrlsSchema } from "./output" +import type { Country } from "@scandic-hotels/common/constants/country" import type { Lang } from "@scandic-hotels/common/constants/language" import type { GetDestinationCityListDataResponse } from "../../../types/destinationCityPage" diff --git a/packages/trpc/lib/routers/contentstack/destinationOverviewPage/query.ts b/packages/trpc/lib/routers/contentstack/destinationOverviewPage/query.ts index 3a8318fc7..cfafe6112 100644 --- a/packages/trpc/lib/routers/contentstack/destinationOverviewPage/query.ts +++ b/packages/trpc/lib/routers/contentstack/destinationOverviewPage/query.ts @@ -12,7 +12,7 @@ import { contentstackExtendedProcedureUID, serviceProcedure, } from "../../../procedures" -import { ApiCountry, type Country } from "../../../types/country" +import { ApiCountry } from "../../../types/country" import { generateRefsResponseTag, generateTag, @@ -28,6 +28,8 @@ import { } from "./output" import { getSortedDestinationsByLanguage } from "./utils" +import type { Country } from "@scandic-hotels/common/constants/country" + import type { GetDestinationOverviewPageData, GetDestinationOverviewPageRefsSchema, diff --git a/packages/trpc/lib/routers/contentstack/destinationOverviewPage/utils.ts b/packages/trpc/lib/routers/contentstack/destinationOverviewPage/utils.ts index 30f961da2..061cc1469 100644 --- a/packages/trpc/lib/routers/contentstack/destinationOverviewPage/utils.ts +++ b/packages/trpc/lib/routers/contentstack/destinationOverviewPage/utils.ts @@ -1,6 +1,7 @@ +import { Country } from "@scandic-hotels/common/constants/country" import { Lang } from "@scandic-hotels/common/constants/language" -import { ApiCountry, Country } from "../../../types/country" +import { ApiCountry } from "../../../types/country" import type { DestinationsData } from "../../../types/destinationsData" diff --git a/packages/trpc/lib/routers/contentstack/metadata/output.ts b/packages/trpc/lib/routers/contentstack/metadata/output.ts index b9a756b4c..cdbbb37c4 100644 --- a/packages/trpc/lib/routers/contentstack/metadata/output.ts +++ b/packages/trpc/lib/routers/contentstack/metadata/output.ts @@ -1,5 +1,6 @@ import { z } from "zod" +import { Country } from "@scandic-hotels/common/constants/country" import { type FindMyBookingRoute, findMyBookingRoutes, @@ -7,7 +8,6 @@ import { import { myStay } from "@scandic-hotels/common/constants/routes/myStay" import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault" -import { Country } from "../../../types/country" import { RTETypeEnum } from "../../../types/RTEenums" import { destinationFilterSchema } from "../schemas/destinationFilters" import { systemSchema } from "../schemas/system" diff --git a/packages/trpc/lib/routers/contentstack/schemas/blocks/hotelListing.ts b/packages/trpc/lib/routers/contentstack/schemas/blocks/hotelListing.ts index c1872dda1..6b7e3736a 100644 --- a/packages/trpc/lib/routers/contentstack/schemas/blocks/hotelListing.ts +++ b/packages/trpc/lib/routers/contentstack/schemas/blocks/hotelListing.ts @@ -1,7 +1,8 @@ import { z } from "zod" +import { Country } from "@scandic-hotels/common/constants/country" + import { BlocksEnums } from "../../../../types/blocksEnum" -import { Country } from "../../../../types/country" export const locationFilterSchema = z .object({ diff --git a/packages/trpc/lib/routers/hotels/input.ts b/packages/trpc/lib/routers/hotels/input.ts index c88e4ec5c..237afc02b 100644 --- a/packages/trpc/lib/routers/hotels/input.ts +++ b/packages/trpc/lib/routers/hotels/input.ts @@ -1,11 +1,11 @@ import { z } from "zod" +import { Country } from "@scandic-hotels/common/constants/country" import { Lang } from "@scandic-hotels/common/constants/language" import { BreakfastPackageEnum } from "../../enums/breakfast" import { ChildBedMapEnum } from "../../enums/childBedMapEnum" import { RoomPackageCodeEnum } from "../../enums/roomFilter" -import { Country } from "../../types/country" const childrenInRoomSchema = z .array( diff --git a/packages/trpc/lib/routers/hotels/services/getLocationsByCountries.ts b/packages/trpc/lib/routers/hotels/services/getLocationsByCountries.ts index be684aa61..07da73f93 100644 --- a/packages/trpc/lib/routers/hotels/services/getLocationsByCountries.ts +++ b/packages/trpc/lib/routers/hotels/services/getLocationsByCountries.ts @@ -12,10 +12,9 @@ import { locationCitySchema } from "../schemas/location/city" import { locationHotelSchema } from "../schemas/location/hotel" import { getCity } from "./getCity" +import type { Country } from "@scandic-hotels/common/constants/country" import type { Lang } from "@scandic-hotels/common/constants/language" -import type { Country } from "../../../types/country" - const hotelUtilsLogger = createLogger("getLocationsByCountries") type CitiesNamesByCountry = Record< diff --git a/packages/trpc/lib/types/country.ts b/packages/trpc/lib/types/country.ts index 27cfbe103..75e10eafd 100644 --- a/packages/trpc/lib/types/country.ts +++ b/packages/trpc/lib/types/country.ts @@ -1,14 +1,6 @@ +import { Country } from "@scandic-hotels/common/constants/country" import { Lang } from "@scandic-hotels/common/constants/language" -export enum Country { - Denmark = "Denmark", - Finland = "Finland", - Germany = "Germany", - Norway = "Norway", - Poland = "Poland", - Sweden = "Sweden", -} - export const ApiCountry: Record> = { [Lang.da]: { [Country.Denmark]: "Danmark", diff --git a/packages/trpc/lib/types/locations.ts b/packages/trpc/lib/types/locations.ts index b39cc935b..cff831edd 100644 --- a/packages/trpc/lib/types/locations.ts +++ b/packages/trpc/lib/types/locations.ts @@ -1,3 +1,4 @@ +import type { Country } from "@scandic-hotels/common/constants/country" import type { z } from "zod" import type { @@ -5,7 +6,6 @@ import type { countriesSchema, locationsSchema, } from "../routers/hotels/output" -import type { Country } from "./country" export interface LocationSchema extends z.output {}