Merged in chore/move-enter-details (pull request #2778)

Chore/move enter details

Approved-by: Anton Gunnarsson
This commit is contained in:
Joakim Jäderberg
2025-09-11 07:16:24 +00:00
parent 15711cb3a4
commit 7dee6d5083
238 changed files with 1656 additions and 1602 deletions

View File

@@ -1,10 +1,12 @@
import {
multiroomErrors,
roomOneErrors,
} from "@scandic-hotels/booking-flow/components/EnterDetails/enterDetailsErrors"
import { logger } from "@scandic-hotels/common/logger"
import { phoneErrors } from "@scandic-hotels/common/utils/zod/phoneValidator"
import { signupErrors } from "@scandic-hotels/trpc/routers/user/schemas"
import { editProfileErrors } from "@/components/Forms/Edit/Profile/schema"
import { multiroomErrors } from "@/components/HotelReservation/EnterDetails/Details/Multiroom/schema"
import { roomOneErrors } from "@/components/HotelReservation/EnterDetails/Details/RoomOne/schema"
import { findMyBookingErrors } from "@/components/HotelReservation/FindMyBooking/schema"
import type { IntlShape } from "react-intl"

View File

@@ -1,21 +0,0 @@
import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
import type { Packages } from "@scandic-hotels/trpc/types/packages"
export function getSpecialRoomType(
packages: BookingConfirmation["booking"]["packages"] | Packages | null
) {
const packageCodes = packages
?.filter((pkg) => pkg.code)
.map((pkg) => pkg.code)
if (packageCodes?.includes(RoomPackageCodeEnum.ACCESSIBILITY_ROOM)) {
return "accesibillity"
} else if (packageCodes?.includes(RoomPackageCodeEnum.ALLERGY_ROOM)) {
return "allergy friendly"
} else if (packageCodes?.includes(RoomPackageCodeEnum.PET_ROOM)) {
return "pet room"
} else {
return ""
}
}

View File

@@ -1,8 +1,8 @@
"use client"
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
import type { LowestRoomPriceEvent } from "@scandic-hotels/common/tracking/types"
import type { LowestRoomPriceEvent } from "@scandic-hotels/tracking/types"
import type { BreakfastPackages } from "@scandic-hotels/trpc/routers/hotels/output"
export function trackLowestRoomPrice(event: LowestRoomPriceEvent) {

View File

@@ -1,5 +1,5 @@
"use client"
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
export function trackAccordionClick(option: string) {
trackEvent({

View File

@@ -1,4 +1,4 @@
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
export function trackSortingChangeEvent(sortOption: string) {
trackEvent({

View File

@@ -1,4 +1,4 @@
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
export function trackHotelMapClick() {
trackEvent({

View File

@@ -12,9 +12,9 @@ export {
trackSocialMediaClick,
} from "./navigation"
export { trackPaymentEvent, trackUpdatePaymentMethod } from "./payment"
export { trackClick } from "@scandic-hotels/common/tracking/base"
export { trackClick } from "@scandic-hotels/tracking/base"
export {
createSDKPageObject,
trackPageView,
trackPageViewStart,
} from "@scandic-hotels/common/tracking/pageview"
} from "@scandic-hotels/tracking/pageview"

View File

@@ -1,5 +1,5 @@
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
import type { PackageSchema } from "@scandic-hotels/trpc/types/bookingConfirmation"
@@ -35,13 +35,17 @@ export function trackMyStayPageLink(ctaName: string) {
})
}
type LateArrivalGuarantee = "mandatory" | "yes" | "no" | "na"
export function trackGlaSaveCardAttempt(
hotelId: string,
savedCreditCard: CreditCard | undefined,
lateArrivalGuarantee: LateArrivalGuarantee
) {
export function trackGlaSaveCardAttempt({
hotelId,
hasSavedCreditCard,
creditCardType,
lateArrivalGuarantee,
}: {
hotelId: string
hasSavedCreditCard: boolean
creditCardType?: string
lateArrivalGuarantee: "mandatory" | "yes" | "no" | "na"
}) {
trackEvent({
event: "glaCardSaveAttempt",
hotelInfo: {
@@ -51,8 +55,8 @@ export function trackGlaSaveCardAttempt(
},
paymentInfo: {
status: "glacardsaveattempt",
isSavedCreditCard: !!savedCreditCard,
type: savedCreditCard?.cardType,
isSavedCreditCard: hasSavedCreditCard,
type: creditCardType,
},
})
}

View File

@@ -1,6 +1,6 @@
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
import type { TrackingPosition } from "@scandic-hotels/common/tracking/types"
import type { TrackingPosition } from "@scandic-hotels/tracking/types"
export function trackFooterClick(group: string, name: string) {
trackEvent({

View File

@@ -1,9 +1,9 @@
import { trackEvent } from "@scandic-hotels/common/tracking/base"
import { trackEvent } from "@scandic-hotels/tracking/base"
import type {
PaymentEvent,
PaymentFailEvent,
} from "@scandic-hotels/common/tracking/types"
} from "@scandic-hotels/tracking/types"
function isPaymentFailEvent(event: PaymentEvent): event is PaymentFailEvent {
return "errorMessage" in event