129 lines
3.5 KiB
TypeScript
129 lines
3.5 KiB
TypeScript
import { MembershipLevel } from "@/constants/membershipLevels"
|
|
|
|
import type { Lang } from "@/constants/languages"
|
|
|
|
export enum TrackingChannelEnum {
|
|
"scandic-friends" = "scandic-friends",
|
|
"static-content-page" = "static-content-page",
|
|
}
|
|
|
|
export type TrackingChannel = keyof typeof TrackingChannelEnum
|
|
|
|
export type TrackingSDKPageData = {
|
|
pageId: string
|
|
createdDate: string
|
|
publishedDate: string
|
|
domainLanguage: Lang
|
|
pageType: string
|
|
channel: TrackingChannel
|
|
siteVersion?: "new-web"
|
|
pageName: string | null
|
|
domain?: string
|
|
siteSections: string | null
|
|
pageLoadTime?: number // Page load time in seconds
|
|
}
|
|
|
|
export enum LoginTypeEnum {
|
|
email = "email",
|
|
"membership number" = "membership number",
|
|
"email link" = "email link",
|
|
}
|
|
export type LoginType = keyof typeof LoginTypeEnum
|
|
|
|
export type TrackingSDKUserData = {
|
|
loginStatus: "logged in" | "Non-logged in"
|
|
loginType?: LoginType
|
|
memberId?: string
|
|
memberLevel?: MembershipLevel
|
|
noOfNightsStayed?: number
|
|
totalPointsAvailableToSpend?: number
|
|
loginAction?: "login success"
|
|
}
|
|
|
|
export type TrackingSDKHotelInfo = {
|
|
hotelID?: string
|
|
arrivalData?: Date
|
|
departureDate?: Date
|
|
noAdults?: number
|
|
noChildren?: number
|
|
ageOfChildren?: string // "10", "2,5,10"
|
|
//rewardNight?: boolean
|
|
//bookingCode?: string
|
|
//bookingCodeAvailability?: boolean
|
|
leadTime?: number // Number of days from booking date until arrivalDate
|
|
noOfRoom?: number
|
|
//bonuscheque?: boolean
|
|
childBedPreference?: string
|
|
duration?: number // Number of nights to stay
|
|
availableResults?: number // Number of hotels to choose from after a city search
|
|
bookingTypeofDay?: string // Weekend or weekday
|
|
searchTerm?: string
|
|
roomPrice?: string
|
|
rateCode?: string
|
|
rateCodeCancellationRule?: string
|
|
rateCodeName?: string // Scandic Friends - full flex inkl. frukost
|
|
rateCodeType?: string // regular, promotion etc
|
|
revenueCurrencyCode?: string // SEK, DKK, NOK, EUR
|
|
roomTypeCode?: string
|
|
roomTypePosition?: number // Which position the room had in the list of available rooms
|
|
roomTypeName?: string
|
|
bedType?: string
|
|
bedTypePosition?: number // Which position the bed type had in the list of available bed types
|
|
breakfastOption?: string // "no breakfast" or "breakfast buffet"
|
|
bnr?: string // Booking number
|
|
analyticsrateCode?: string // flex, save, change
|
|
specialRoomType?: string // allergy room, pet-friendly, accesibillity room
|
|
//modifyValues?: string // <price:<value>,roomtype:value>,bed:<value,<breakfast:value>
|
|
country?: string // Country of the hotel
|
|
region?: string // Region of the hotel
|
|
discount?: number
|
|
totalPrice?: number
|
|
lowestRoomPrice?: number
|
|
}
|
|
|
|
export type TrackingSDKProps = {
|
|
pageData: TrackingSDKPageData
|
|
userData: TrackingSDKUserData
|
|
hotelInfo?: TrackingSDKHotelInfo
|
|
}
|
|
|
|
export type TrackingSDKData = TrackingSDKPageData & {
|
|
pathName: string
|
|
}
|
|
|
|
export type TrackingPosition =
|
|
| "top menu"
|
|
| "hamburger menu"
|
|
| "join scandic friends sidebar"
|
|
|
|
// Old tracking setup types:
|
|
// TODO: Remove this when we delete "current site"
|
|
export type TrackingProps = {
|
|
pageData: {
|
|
pageId: string
|
|
createdDate: string
|
|
publishedDate: string
|
|
englishUrl?: string
|
|
lang: Lang
|
|
}
|
|
}
|
|
|
|
export type TrackingData = {
|
|
lang: Lang
|
|
englishUrl?: string
|
|
pathName: string
|
|
queryString: string
|
|
pageId: string
|
|
publishedDate: string
|
|
createdDate: string
|
|
}
|
|
|
|
export type SiteSectionObject = {
|
|
sitesection1: string
|
|
sitesection2: string
|
|
sitesection3: string
|
|
sitesection4: string
|
|
sitesection5: string
|
|
sitesection6: string
|
|
}
|