Merged in monorepo-step-1 (pull request #1080)

Migrate to a monorepo setup - step 1

* Move web to subfolder /apps/scandic-web

* Yarn + transitive deps

- Move to yarn
- design-system package removed for now since yarn doesn't
support the parameter for token (ie project currently broken)
- Add missing transitive dependencies as Yarn otherwise
prevents these imports
- VS Code doesn't pick up TS path aliases unless you open
/apps/scandic-web instead of root (will be fixed with monorepo)

* Pin framer-motion to temporarily fix typing issue

https://github.com/adobe/react-spectrum/issues/7494

* Pin zod to avoid typ error

There seems to have been a breaking change in the types
returned by zod where error is now returned as undefined
instead of missing in the type. We should just handle this
but to avoid merge conflicts just pin the dependency for
now.

* Pin react-intl version

Pin version of react-intl to avoid tiny type issue where formatMessage
does not accept a generic any more. This will be fixed in a future
commit, but to avoid merge conflicts just pin for now.

* Pin typescript version

Temporarily pin version as newer versions as stricter and results in
a type error. Will be fixed in future commit after merge.

* Setup workspaces

* Add design-system as a monorepo package

* Remove unused env var DESIGN_SYSTEM_ACCESS_TOKEN

* Fix husky for monorepo setup

* Update netlify.toml

* Add lint script to root package.json

* Add stub readme

* Fix react-intl formatMessage types

* Test netlify.toml in root

* Remove root toml

* Update netlify.toml publish path

* Remove package-lock.json

* Update build for branch/preview builds


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-02-26 10:36:17 +00:00
committed by Linus Flood
parent 667cab6fb6
commit 80100e7631
2731 changed files with 30986 additions and 23708 deletions

View File

@@ -0,0 +1,14 @@
/**
* How many seconds before the expiry of the access token
* the client should refresh the tokens.
* Should be ~10% of the token lifetime.
* The token life time is 30 minutes
*/
export const PRE_REFRESH_TIME_IN_SECONDS = 180
/**
* How many minutes the client should be allowed to be inactive
* and still get the tokens refreshed. The inactivity control
* gets reset when the URL changes.
*/
export const MAX_KEEP_ALIVE_TIME_IN_MINUTES = 2 * 60

View File

@@ -0,0 +1,150 @@
import {
ExtraBunkBedIcon,
ExtraPullOutBedIcon,
ExtraSofaBedIcon,
ExtraWallBedIcon,
KingBedIcon,
QueenBedIcon,
SingleBedIcon,
TwinBedsIcon,
} from "@/components/Icons"
import type { IconProps } from "@/types/components/icon"
export enum BookingStatusEnum {
BookingCompleted = "BookingCompleted",
Cancelled = "Cancelled",
CheckedOut = "CheckedOut",
ConfirmedInScorpio = "ConfirmedInScorpio",
CreatedInOhip = "CreatedInOhip",
PaymentAuthorized = "PaymentAuthorized",
PaymentCancelled = "PaymentCancelled",
PaymentError = "PaymentError",
PaymentFailed = "PaymentFailed",
PaymentRegistered = "PaymentRegistered",
PaymentSucceeded = "PaymentSucceeded",
PendingAcceptPriceChange = "PendingAcceptPriceChange",
PendingGuarantee = "PendingGuarantee",
PendingPayment = "PendingPayment",
}
export enum ChildBedTypeEnum {
Crib = "Crib",
ExtraBed = "ExtraBed",
ParentsBed = "ParentsBed",
Unknown = "Unknown",
}
export const BOOKING_CONFIRMATION_NUMBER = "confirmationNumber"
export const MEMBERSHIP_FAILED_ERROR = "MembershipFailedError"
export enum PaymentMethodEnum {
card = "card",
swish = "swish",
vipps = "vipps",
mobilePay = "mobilePay",
applePay = "applePay",
googlePay = "googlePay",
alipayPlus = "alipayPlus",
weChatPay = "weChatPay",
payPal = "payPal",
klarna = "klarna",
americanExpress = "americanExpress",
dankort = "dankort",
dinersClub = "dinersClub",
jcb = "jcb",
masterCard = "masterCard",
visa = "visa",
maestro = "maestro",
chinaUnionPay = "chinaUnionPay",
discover = "discover",
}
export enum PaymentErrorCodeEnum {
Abandoned = 5,
Cancelled = 6,
Failed = 7,
}
export const PAYMENT_METHOD_TITLES: Record<
keyof typeof PaymentMethodEnum,
string
> = {
card: "Credit card",
swish: "Swish",
vipps: "Vipps",
mobilePay: "MobilePay",
applePay: "Apple Pay",
googlePay: "Google Pay",
alipayPlus: "Alipay+",
weChatPay: "WeChat Pay",
payPal: "PayPal",
klarna: "Klarna",
americanExpress: "American Express",
dankort: "Dankort",
dinersClub: "Diners Club",
jcb: "JCB",
masterCard: "Mastercard",
visa: "Visa",
maestro: "Maestro",
chinaUnionPay: "China UnionPay",
discover: "Discover",
}
export const PAYMENT_METHOD_ICONS: Record<
keyof typeof PaymentMethodEnum,
string
> = {
card: "/_static/icons/payment/mastercard.svg",
swish: "/_static/icons/payment/swish.svg",
vipps: "/_static/icons/payment/vipps.svg",
mobilePay: "/_static/icons/payment/mobilepay.svg",
applePay: "/_static/icons/payment/apple-pay.svg",
googlePay: "/_static/icons/payment/google-pay.svg",
alipayPlus: "/_static/icons/payment/alipay-plus.svg",
weChatPay: "/_static/icons/payment/wechat-pay.svg",
payPal: "/_static/icons/payment/paypal.svg",
klarna: "/_static/icons/payment/klarna.svg",
americanExpress: "/_static/icons/payment/american-express.svg",
dankort: "/_static/icons/payment/dankort.svg",
dinersClub: "/_static/icons/payment/diners-club.svg",
jcb: "/_static/icons/payment/jcb.svg",
masterCard: "/_static/icons/payment/mastercard.svg",
visa: "/_static/icons/payment/visa.svg",
maestro: "/_static/icons/payment/maestro.svg",
chinaUnionPay: "/_static/icons/payment/china-union-pay.svg",
discover: "/_static/icons/payment/discover.svg",
}
export enum BedTypeEnum {
King = "King",
Queen = "Queen",
Single = "Single",
Twin = "Twin",
Other = "Other",
}
export enum ExtraBedTypeEnum {
SofaBed = "SofaBed",
WallBed = "WallBed",
PullOutBed = "PullOutBed",
BunkBed = "BunkBed",
}
type BedTypes = keyof typeof BedTypeEnum | keyof typeof ExtraBedTypeEnum
export const BED_TYPE_ICONS: Record<
BedTypes,
(props: IconProps) => JSX.Element
> = {
King: KingBedIcon,
Queen: QueenBedIcon,
Single: SingleBedIcon,
Twin: TwinBedsIcon,
SofaBed: ExtraSofaBedIcon,
WallBed: ExtraWallBedIcon,
BunkBed: ExtraBunkBedIcon,
PullOutBed: ExtraPullOutBedIcon,
Other: SingleBedIcon,
}

View File

@@ -0,0 +1,55 @@
import type { LangRoute } from "@/types/routes"
const baseUrl: LangRoute = {
da: "https://www.scandichotels.dk",
de: "https://www.scandichotels.de",
en: "https://www.scandichotels.com",
fi: "https://www.scandichotels.fi",
no: "https://www.scandichotels.no",
sv: "https://www.scandichotels.se",
}
export const bookingTermsAndConditions: LangRoute = {
da: `${baseUrl.da}/kundeservice/priser-og-bookingvilkar/vilkar-og-betingelser3`,
de: `${baseUrl.de}/kundenbetreuung/preise-und-richtlinien/reservierungsbedingungen`,
en: `${baseUrl.en}/customer-service/rates-and-policies/terms-conditions`,
fi: `${baseUrl.fi}/asiakaspalvelu/hinnat-ja-varausehdot/varausehdot`,
no: `${baseUrl.no}/kundeservice/priser-og-bestillingsvilkar/reservasjonsbetingelser`,
sv: `${baseUrl.sv}/kundservice/priser-och-bokningsregler/bokningsregler`,
}
export const membershipTermsAndConditions: LangRoute = {
da: `${baseUrl.da}/kundeservice/priser-og-bookingvilkar/vilkar-betingelser-for-medlemsskab`,
de: `${baseUrl.de}/kundenbetreuung/preise-und-richtlinien/scandic-friends-allgemeine-geschaftsbedingungen`,
en: `${baseUrl.en}/customer-service/rates-and-policies/scandic-friends-terms-conditions`,
fi: `${baseUrl.fi}/asiakaspalvelu/hinnat-ja-varausehdot/jasenyyden-ehdot`,
no: `${baseUrl.no}/kundeservice/priser-og-bestillingsvilkar/betingelser-for-medlemskap`,
sv: `${baseUrl.sv}/kundservice/priser-och-bokningsregler/medlemsvillkor`,
}
export const faq: LangRoute = {
da: `${baseUrl.da}/scandic-friends/hjalp-og-service/ofte-stillede-sporgsmal`,
de: `${baseUrl.de}/scandic-friends/hilfe-und-service/haufig-gestellte-fragen`,
en: `${baseUrl.en}/scandic-friends/help-service/faq`,
fi: `${baseUrl.fi}/scandic-friends/apua-ongelmatilanteissa/usein-kysyttya`,
no: `${baseUrl.no}/scandic-friends/hjelp-og-medlemsservice/ofte-stilte-sporsmal`,
sv: `${baseUrl.sv}/scandic-friends/hjalp-och-service/vanliga-fragor`,
}
export const privacyPolicy: LangRoute = {
da: `${baseUrl.da}/kundeservice/priser-og-bookingvilkar/persondatapolitik`,
de: `${baseUrl.de}/kundenbetreuung/preise-und-richtlinien/datenschutzrichtlinie`,
en: `${baseUrl.en}/customer-service/rates-and-policies/privacy-policy`,
fi: `${baseUrl.fi}/asiakaspalvelu/hinnat-ja-varausehdot/tietosuojaseloste`,
no: `${baseUrl.no}/kundeservice/priser-og-bestillingsvilkar/personvernpolicy`,
sv: `${baseUrl.sv}/kundservice/priser-och-bokningsregler/integritetspolicy`,
}
export const customerService: LangRoute = {
da: `${baseUrl.da}/kundeservice`,
de: `${baseUrl.de}/kundenbetreuung`,
en: `${baseUrl.en}/customer-service`,
fi: `${baseUrl.fi}/asiakaspalvelu`,
no: `${baseUrl.no}/kundeservice`,
sv: `${baseUrl.sv}/kundservice`,
}

View File

@@ -0,0 +1,26 @@
export const homeHrefs = {
development: {
da: "https://stage.scandichotels.dk",
de: "https://stage.scandichotels.de",
en: "https://stage.scandichotels.com",
fi: "https://stage.scandichotels.fi",
no: "https://stage.scandichotels.no",
sv: "https://stage.scandichotels.se",
},
production: {
da: "https://www.scandichotels.dk",
de: "https://www.scandichotels.de",
en: "https://www.scandichotels.com",
fi: "https://www.scandichotels.fi",
no: "https://www.scandichotels.no",
sv: "https://www.scandichotels.se",
},
test: {
da: "https://test.scandichotels.dk",
de: "https://test.scandichotels.de",
en: "https://test.scandichotels.com",
fi: "https://test.scandichotels.fi",
no: "https://test.scandichotels.no",
sv: "https://test.scandichotels.se",
},
}

View File

@@ -0,0 +1,87 @@
export enum Lang {
da = "da",
de = "de",
en = "en",
fi = "fi",
no = "no",
sv = "sv",
}
export const languages: Record<Lang, string> = {
[Lang.da]: "Dansk",
[Lang.de]: "Deutsch",
[Lang.en]: "English",
[Lang.fi]: "Suomi",
[Lang.no]: "Norsk",
[Lang.sv]: "Svenska",
}
export const localeToLang: Record<string, Lang> = {
en: Lang.en,
"en-US": Lang.en,
"en-GB": Lang.en,
"en-DE": Lang.en,
"en-DK": Lang.en,
"en-SE": Lang.en,
"en-FI": Lang.en,
sv: Lang.sv,
"se-SE": Lang.sv,
"sv-SE": Lang.sv,
"sv-FI": Lang.sv,
fi: Lang.fi,
"fi-FI": Lang.fi,
"se-FI": Lang.fi,
"smn-FI": Lang.fi,
dk: Lang.da,
da: Lang.da,
"da-DK": Lang.da,
"fo-DK": Lang.da,
de: Lang.de,
"de-DE": Lang.de,
"dsb-DE": Lang.de,
"ksh-DE": Lang.de,
"nds-DE": Lang.de,
"hsb-DE": Lang.de,
"de-CH": Lang.de,
"de-AU": Lang.de,
no: Lang.no,
nb: Lang.no,
"nb-NO": Lang.no,
"nn-NO": Lang.no,
"se-NO": Lang.no,
} as const
export enum ApiLang {
Da = "Da",
De = "De",
En = "En",
Fi = "Fi",
No = "No",
Sv = "Sv",
Unknown = "Unknown",
}
type ApiLangKey = keyof typeof ApiLang
export const langToApiLang: Record<Lang, ApiLangKey> = {
[Lang.da]: ApiLang.Da,
[Lang.de]: ApiLang.De,
[Lang.en]: ApiLang.En,
[Lang.fi]: ApiLang.Fi,
[Lang.no]: ApiLang.No,
[Lang.sv]: ApiLang.Sv,
}
export const languageSelect = [
{ label: "Danish", value: ApiLang.Da },
{ label: "German", value: ApiLang.De },
{ label: "English", value: ApiLang.En },
{ label: "Finnish", value: ApiLang.Fi },
{ label: "Norwegian", value: ApiLang.No },
{ label: "Swedish", value: ApiLang.Sv },
]

View File

@@ -0,0 +1,31 @@
export enum membershipLevels {
L1 = 1,
L2 = 2,
L3 = 3,
L4 = 4,
L5 = 5,
L6 = 6,
L7 = 7,
}
export enum MembershipLevelEnum {
L1 = "L1",
L2 = "L2",
L3 = "L3",
L4 = "L4",
L5 = "L5",
L6 = "L6",
L7 = "L7",
}
export const TIER_TO_FRIEND_MAP: Record<MembershipLevelEnum, string> = {
[MembershipLevelEnum.L1]: "New Friend",
[MembershipLevelEnum.L2]: "Good Friend",
[MembershipLevelEnum.L3]: "Close Friend",
[MembershipLevelEnum.L4]: "Dear Friend",
[MembershipLevelEnum.L5]: "Loyal Friend",
[MembershipLevelEnum.L6]: "True Friend",
[MembershipLevelEnum.L7]: "Best Friend",
}
export type MembershipLevel = keyof typeof MembershipLevelEnum

View File

@@ -0,0 +1,26 @@
export const myBooking = {
development: {
da: "https://stage.scandichotels.dk/hotelreservation/min-booking",
de: "https://stage.scandichotels.de/hotelreservation/my-booking",
en: "https://stage.scandichotels.com/hotelreservation/my-booking",
fi: "https://stage.scandichotels.fi/varaa-hotelli/varauksesi",
no: "https://stage.scandichotels.no/hotelreservation/my-booking",
sv: "https://stage.scandichotels.se/hotelreservation/din-bokning",
},
production: {
da: "https://www.scandichotels.dk/hotelreservation/min-booking",
de: "https://www.scandichotels.de/hotelreservation/my-booking",
en: "https://www.scandichotels.com/hotelreservation/my-booking",
fi: "https://www.scandichotels.fi/varaa-hotelli/varauksesi",
no: "https://www.scandichotels.no/hotelreservation/my-booking",
sv: "https://www.scandichotels.se/hotelreservation/din-bokning",
},
test: {
da: "https://test.scandichotels.dk/hotelreservation/min-booking",
de: "https://test.scandichotels.de/hotelreservation/my-booking",
en: "https://test.scandichotels.com/hotelreservation/my-booking",
fi: "https://test.scandichotels.fi/varaa-hotelli/varauksesi",
no: "https://test.scandichotels.no/hotelreservation/my-booking",
sv: "https://test.scandichotels.se/hotelreservation/din-bokning",
},
}

View File

@@ -0,0 +1,19 @@
export enum PoiCategories {
"Airport" = "airport",
"Amusement park" = "amusementPark",
"Bus terminal" = "busTerminal",
"Fair" = "fair",
"Hospital" = "hospital",
"Hotel" = "hotel",
"Marketing city" = "marketingCity",
"Museum" = "museum",
"Nearby companies" = "nearbyCompanies",
"Parking / Garage" = "parkingGarage",
"Restaurant" = "restaurant",
"Shopping" = "shopping",
"Sports" = "sports",
"Theatre" = "theatre",
"Tourist" = "tourist",
"Transportations" = "transportations",
"Zoo" = "zoo",
}

View File

@@ -0,0 +1,47 @@
export const REWARD_IDS = {
// Food & Beverage
TenPercentFood: "tier_10_percent_food_tier",
TwoForOneBreakfast: "tier_2_for_one_breakfast",
FifteenPercentFood: "tier_15_percent_food",
FreeKidsDrink: "tier_free_kids_drink",
FreeBreakfast: "tier_free_breakfast",
// Monetary Vouchers
Bonus50SEK: "tier_50_SEK_bonus_voucher",
Bonus75SEK: "tier_75_SEK_bonus_voucher",
Bonus100SEK: "tier_100_SEK_bonus_voucher",
Bonus150SEK: "tier_150_SEK_bonus_voucher",
Bonus200SEK: "tier_200_SEK_bonus_voucher",
// Hotel Perks
EarlyCheckin: "tier_early_checkin_tier",
LateCheckout: "tier_late_checkout",
FreeUpgrade: "tier_free_upgrade",
RoomGuarantee48H: "tier_48_h_room_guarantee",
// GymAccess: "tier_gym_access",
// Earning & Points
EarnRate25Percent: "tier_25_percent_earn_rate",
EarnRate50Percent: "tier_50_percent_earn_rate",
StayBoostForKids: "tier_stay_boost_for_kids",
MemberRate: "tier_member_rate",
// Special
YearlyExclusiveGift: "tier_yearly_exclusive_gift",
} as const
export const RESTAURANT_REWARD_IDS = [
REWARD_IDS.TenPercentFood,
REWARD_IDS.TwoForOneBreakfast,
REWARD_IDS.FifteenPercentFood,
REWARD_IDS.FreeKidsDrink,
REWARD_IDS.FreeBreakfast,
] as const
export const COUPON_REWARD_TYPES = [
"Surprise",
"Campaign",
"Member-voucher",
] as const
export const REWARD_TYPES = [...COUPON_REWARD_TYPES, "Tier"] as const

View File

@@ -0,0 +1,26 @@
import {
benefits,
myPages,
overview,
points,
profile,
profileEdit,
stays,
} from "./myPages"
/**
* These are routes in code we know requires auth
*
* Some of these are rewritten in next.config.js
*/
export const authRequired = [
...Object.values(benefits),
...Object.values(myPages),
...Object.values(overview),
...Object.values(profile),
...Object.values(profileEdit),
...Object.values(stays),
...Object.values(points),
]
export const mfaRequired = [...Object.values(profileEdit)]

View File

@@ -0,0 +1,10 @@
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
export const baseUrls: LanguageSwitcherData = {
da: { url: "/da/" },
de: { url: "/de/" },
en: { url: "/en/" },
fi: { url: "/fi/" },
no: { url: "/no/" },
sv: { url: "/sv/" },
}

View File

@@ -0,0 +1,61 @@
/**
* These are routes for login, logout, signup, etc.
*/
/** @type {import('@/types/routes').LangRoute} */
export const login = {
da: "/da/log-pa",
de: "/de/anmeldung",
en: "/en/login",
fi: "/fi/kirjaudu-sisaan",
no: "/no/logg-inn",
sv: "/sv/logga-in",
}
/** @type {import('@/types/routes').LangRoute} */
export const loginUnLocalized = {
da: "/da/login",
de: "/de/login",
en: "/en/login",
fi: "/fi/login",
no: "/no/login",
sv: "/sv/login",
}
/** @type {import('@/types/routes').LangRoute} */
export const logout = {
da: "/da/log-ud",
de: "/de/ausloggen",
en: "/en/logout",
fi: "/fi/kirjaudu-ulos",
no: "/no/logg-ut",
sv: "/sv/logga-ut",
}
/** @type {import('@/types/routes').LangRoute} */
export const logoutUnLocalized = {
da: "/da/logout",
de: "/de/logout",
en: "/en/logout",
fi: "/fi/logout",
no: "/no/logout",
sv: "/sv/logout",
}
/** @type {import('@/types/routes').LangRoute} */
export const verifymagiclink = {
da: "/da/verifymagiclink",
de: "/de/verifymagiclink",
en: "/en/verifymagiclink",
fi: "/fi/verifymagiclink",
no: "/no/verifymagiclink",
sv: "/sv/verifymagiclink",
}
export const handleAuth = [
...Object.values(login),
...Object.values(logout),
...Object.values(verifymagiclink),
...Object.values(loginUnLocalized),
...Object.values(logoutUnLocalized),
]

View File

@@ -0,0 +1,59 @@
/**
* @typedef {import('@/constants/languages').Lang} Lang
*/
/**
* @param {Lang} lang
*/
export function hotelreservation(lang) {
return `/${lang}/hotelreservation`
}
/**
* @param {Lang} lang
*/
export function bookingConfirmation(lang) {
return `${hotelreservation(lang)}/booking-confirmation`
}
/**
* @param {Lang} lang
*/
export function details(lang) {
return `${hotelreservation(lang)}/details`
}
/**
* @param {Lang} lang
*/
export function selectHotel(lang) {
return `${hotelreservation(lang)}/select-hotel`
}
/**
* @param {Lang} lang
*/
export function selectHotelMap(lang) {
return `${hotelreservation(lang)}/select-hotel/map`
}
/**
* @param {Lang} lang
*/
export function selectRate(lang) {
return `${hotelreservation(lang)}/select-rate`
}
/**
* @param {Lang} lang
*/
export function alternativeHotels(lang) {
return `${hotelreservation(lang)}/alternative-hotels`
}
/**
* @param {Lang} lang
*/
export function alternativeHotelsMap(lang) {
return `${hotelreservation(lang)}/alternative-hotels/map`
}

View File

@@ -0,0 +1,99 @@
/**
* @file Due to these records being used in next.config.js, and that is required
* to be a js file, we use jsdoc to type these.
*/
/**
* These are routes that define code entries for My pages
*/
/** @type {import('@/types/routes').LangRoute} */
export const scandicFriends = {
da: "/da/scandic-friends",
de: "/de/scandic-friends",
en: "/en/scandic-friends",
fi: "/fi/scandic-friends",
no: "/no/scandic-friends",
sv: "/sv/scandic-friends",
}
/** @type {import('@/types/routes').LangRoute} */
export const myPages = {
da: `${scandicFriends.da}/mine-sider`,
de: `${scandicFriends.de}/mein-bereich`,
en: `${scandicFriends.en}/my-pages`,
fi: `${scandicFriends.fi}/omat-sivut`,
no: `${scandicFriends.no}/mine-sider`,
sv: `${scandicFriends.sv}/mina-sidor`,
}
/** @type {import('@/types/routes').LangRoute} */
export const overview = {
da: `${myPages.da}/oversigt`,
de: `${myPages.de}/uberblick`,
en: `${myPages.en}/overview`,
fi: `${myPages.fi}/yleista`,
no: `${myPages.no}/oversikt`,
sv: `${myPages.sv}/oversikt`,
}
/** TODO: Update to relevant paths */
/** @type {import('@/types/routes').LangRoute} */
export const profile = {
da: `${myPages.da}/profil`,
de: `${myPages.de}/profil`,
en: `${myPages.en}/profile`,
fi: `${myPages.fi}/profiili`,
no: `${myPages.no}/profil`,
sv: `${myPages.sv}/profil`,
}
/** @type {import('@/types/routes').LangRoute} */
export const profileEdit = {
da: `${profile.da}/rediger`,
de: `${profile.de}/bearbeiten`,
en: `${profile.en}/edit`,
fi: `${profile.fi}/muokkaa`,
no: `${profile.no}/rediger`,
sv: `${profile.sv}/redigera`,
}
/** @type {import('@/types/routes').LangRoute} */
export const points = {
da: `${myPages.da}/point`,
de: `${myPages.de}/punkte`,
en: `${myPages.en}/points`,
fi: `${myPages.fi}/pisteet`,
no: `${myPages.no}/poeng`,
sv: `${myPages.sv}/poang`,
}
/** @type {import('@/types/routes').LangRoute} */
export const benefits = {
da: `${myPages.da}/fordele`,
de: `${myPages.de}/vorteile`,
en: `${myPages.en}/benefits`,
fi: `${myPages.fi}/edut`,
no: `${myPages.no}/fordeler`,
sv: `${myPages.sv}/formaner`,
}
/** @type {import('@/types/routes').LangRoute} */
export const stays = {
da: `${myPages.da}/ophold`,
de: `${myPages.de}/aufenthalte`,
en: `${myPages.en}/stays`,
fi: `${myPages.fi}/varaukset`,
no: `${myPages.no}/opphold`,
sv: `${myPages.sv}/vistelser`,
}
/** @type {import('@/types/routes').LangRoute} */
export const scandicXSAS = {
da: `${myPages.da}/scandic-x-sas`,
de: `${myPages.de}/scandic-x-sas`,
en: `${myPages.en}/scandic-x-sas`,
fi: `${myPages.fi}/scandic-x-sas`,
no: `${myPages.no}/scandic-x-sas`,
sv: `${myPages.sv}/scandic-x-sas`,
}

View File

@@ -0,0 +1,24 @@
import type { LangRoute } from "@/types/routes"
export const signup: LangRoute = {
en: "/en/scandic-friends/join",
sv: "/sv/scandic-friends/bli-medlem",
no: "/no/scandic-friends/registrer-deg",
fi: "/fi/scandic-friends/liity-jaseneksi",
da: "/da/scandic-friends/tilmeld-dig",
de: "/de/scandic-friends/mitglied-werden",
}
export const signupVerify: LangRoute = {
en: `${signup.en}/verify`,
sv: `${signup.sv}/verifiera`,
no: `${signup.no}/bekreft`,
fi: `${signup.fi}/vahvista`,
da: `${signup.da}/bekraeft`,
de: `${signup.de}/verifizieren`,
}
export function isSignupPage(path: string): boolean {
const signupPaths = [...Object.values(signup), ...Object.values(signupVerify)]
return signupPaths.some((signupPath) => signupPath.includes(path))
}

View File

@@ -0,0 +1,71 @@
const myPages = {
da: "/da/webview/scandic-friends/mine-sider",
de: "/de/webview/scandic-friends/mein-bereich",
en: "/en/webview/scandic-friends/my-pages",
fi: "/fi/webview/scandic-friends/omat-sivut",
no: "/no/webview/scandic-friends/mine-sider",
sv: "/sv/webview/scandic-friends/mina-sidor",
}
export const overview = {
da: `${myPages.da}/oversigt`,
de: `${myPages.de}/uberblick`,
en: `${myPages.en}/overview`,
fi: `${myPages.fi}/yleista`,
no: `${myPages.no}/oversikt`,
sv: `${myPages.sv}/oversikt`,
}
export const benefits = {
da: `${myPages.da}/fordele`,
de: `${myPages.de}/vorteile`,
en: `${myPages.en}/benefits`,
fi: `${myPages.fi}/edut`,
no: `${myPages.no}/fordeler`,
sv: `${myPages.sv}/formaner`,
}
export const points = {
da: `${myPages.da}/point`,
de: `${myPages.de}/punkte`,
en: `${myPages.en}/points`,
fi: `${myPages.fi}/pisteet`,
no: `${myPages.no}/poeng`,
sv: `${myPages.sv}/poang`,
}
export const programOverview = {
da: `/da/webview/scandic-friends`,
de: `/de/webview/scandic-friends`,
en: `/en/webview/scandic-friends`,
fi: `/fi/webview/scandic-friends`,
no: `/no/webview/scandic-friends`,
sv: `/sv/webview/scandic-friends`,
}
const refreshUrl = {
da: `/da/webview/refresh`,
de: `/de/webview/refresh`,
en: `/en/webview/refresh`,
fi: `/fi/webview/refresh`,
no: `/no/webview/refresh`,
sv: `/sv/webview/refresh`,
}
export const webviews = [
...Object.values(benefits),
...Object.values(overview),
...Object.values(points),
...Object.values(programOverview),
...Object.values(refreshUrl),
]
export const myPagesWebviews = [
...Object.values(benefits),
...Object.values(overview),
...Object.values(points),
]
export const loyaltyPagesWebviews = [...Object.values(programOverview)]
export const refreshWebviews = [...Object.values(refreshUrl)]