Files
web/apps/scandic-web/constants/booking.ts
Anton Gunnarsson 322268595d Merged in feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow (pull request #2600)
feat(SW-2873): Move HotelReservationSidePeek to booking-flow

* Move sidepeek store to booking-flow

* Begin move of HotelReservationSidePeek to booking-flow

* Copy Link

* Update AccessibilityAccordionItem

* Split AccessibilityAccordionItem into two components

* Fix tracking for Accordion

* Duplicate ButtonLink to booking-flow TEMP

* AdditionalAmeneties

* wip

* Move sidepeek accordion items

* Remove temp ButtonLink

* Merge branch 'master' into feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow

* Fix accordion tracking

* Merge branch 'master' into feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow

* Update exports

* Fix self-referencing import

* Merge branch 'master' into feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow

* Add 'use client' to tracking function

* Merge branch 'master' into feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow

* Fix TEMP folder

* Refactor sidepeek tracking

* Merge branch 'master' into feat/sw-3218-move-hotelreservationsidepeek-to-booking-flow


Approved-by: Joakim Jäderberg
2025-08-14 12:25:40 +00:00

79 lines
2.3 KiB
TypeScript

import type { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
export const FamilyAndFriendsCodes = ["D000029555", "D000029271", "D000029195"]
export const SEARCHTYPE = "searchtype"
export const MEMBERSHIP_FAILED_ERROR = "MembershipFailedError"
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/card-generic.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 CancellationRuleEnum {
CancellableBefore6PM = "CancellableBefore6PM",
NonCancellable = "NonCancellable",
Changeable = "Changeable",
}
export enum PaymentCallbackStatusEnum {
Success = "success",
Error = "error",
Cancel = "cancel",
}
export function combineRegExps(regexps: RegExp[], flags = "") {
return new RegExp(regexps.map((r) => r.source).join("|"), flags)
}
export const rateTypeRegex = {
ARB: /(^B[a-z]{3}\d{6}$)/,
VOUCHER: /(^VO[0-9a-z]*$)/,
}