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
This commit is contained in:
Anton Gunnarsson
2025-11-03 07:57:39 +00:00
parent b2398dba4a
commit 1eb70766b4
6 changed files with 22 additions and 0 deletions

View File

@@ -4,12 +4,15 @@ import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/r
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: {

View File

@@ -30,6 +30,11 @@ export const env = createEnv({
IRON_SESSION_SECRET: z.string().min(32),
CURITY_ISSUER_USER: z.string(),
CURITY_CLIENT_SECRET_USER: z.string(),
REDEMPTION_ENABLED: z
.string()
.refine((s) => s === "true" || s === "false")
.transform((s) => s === "true")
.default("false"),
},
emptyStringAsUndefined: true,
runtimeEnv: {
@@ -44,5 +49,6 @@ export const env = createEnv({
SAS_AUTH_ENDPOINT: process.env.SAS_AUTH_ENDPOINT,
SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
SENTRY_SERVER_SAMPLERATE: process.env.SENTRY_SERVER_SAMPLERATE,
REDEMPTION_ENABLED: process.env.REDEMPTION_ENABLED,
},
})