Files
web/apps/partner-sas/constants/bookingFlowConfig.ts
Anton Gunnarsson 1eb70766b4 Merged in feat/sw-3580-redemption-feature-flag (pull request #3045)
feat(SW-3580): Add feature toggle enableRedemption to BookingFlowConfig

* Add feature toggle enableRedemption to BookingFlowConfig

* Update error message


Approved-by: Joakim Jäderberg
2025-11-03 07:57:39 +00:00

38 lines
1.6 KiB
TypeScript

import { bookingTermsAndConditionsRoutes } from "@scandic-hotels/common/constants/routes/bookingTermsAndConditionsRoutes"
import { customerService } from "@scandic-hotels/common/constants/routes/customerService"
import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions"
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/privacyPolicyRoutes"
import { env } from "@/env/server"
import type { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlowConfig"
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { LangRoute } from "@scandic-hotels/common/constants/routes/langRoute"
export const bookingFlowConfig: BookingFlowConfig = {
bookingCodeEnabled: false,
redemptionEnabled: env.REDEMPTION_ENABLED === true,
enterDetailsMembershipIdInputLocation: "join-card",
variant: "partner-sas",
routes: {
myStay: routeToScandicWeb(myStay),
bookingTermsAndConditions: routeToScandicWeb(
bookingTermsAndConditionsRoutes
),
membershipTermsAndConditions: routeToScandicWeb(
membershipTermsAndConditions
),
customerService: routeToScandicWeb(customerService),
privacyPolicy: routeToScandicWeb(privacyPolicyRoutes),
},
}
function routeToScandicWeb(route: LangRoute) {
const url = `https://www.scandichotels.com`
return Object.entries(route).reduce((acc, [key, value]) => {
acc[key as Lang] = `${url}${value}`
return acc
}, {} as LangRoute)
}