diff --git a/apps/partner-sas/constants/bookingFlowConfig.ts b/apps/partner-sas/constants/bookingFlowConfig.ts index fb21881cd..8ddb2f6b7 100644 --- a/apps/partner-sas/constants/bookingFlowConfig.ts +++ b/apps/partner-sas/constants/bookingFlowConfig.ts @@ -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: { diff --git a/apps/partner-sas/env/server.ts b/apps/partner-sas/env/server.ts index 110736035..2dd490b4d 100644 --- a/apps/partner-sas/env/server.ts +++ b/apps/partner-sas/env/server.ts @@ -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, }, }) diff --git a/apps/scandic-web/constants/bookingFlowConfig.ts b/apps/scandic-web/constants/bookingFlowConfig.ts index 16330ca7d..54b20da58 100644 --- a/apps/scandic-web/constants/bookingFlowConfig.ts +++ b/apps/scandic-web/constants/bookingFlowConfig.ts @@ -8,6 +8,7 @@ import type { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlow export const bookingFlowConfig: BookingFlowConfig = { bookingCodeEnabled: true, + redemptionEnabled: true, enterDetailsMembershipIdInputLocation: "form", variant: "scandic", routes: { diff --git a/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx b/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx index 848e0514d..a56b60fae 100644 --- a/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx +++ b/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx @@ -10,6 +10,7 @@ import type { BookingFlowVariant } from "./bookingFlowVariants" export type BookingFlowConfig = { bookingCodeEnabled: boolean + redemptionEnabled: boolean enterDetailsMembershipIdInputLocation: "form" | "join-card" variant: BookingFlowVariant routes: { diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/RewardNight/index.tsx b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/RewardNight/index.tsx index 25d1b2cd3..364ca6c11 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/RewardNight/index.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/RewardNight/index.tsx @@ -79,6 +79,8 @@ export default function RewardNight() { } }, [resetOnMultiroomError, ref]) + if (!config.redemptionEnabled) return null + return (