Assist_Design/apps/portal/src/config/feature-flags.ts
barsa d5ad8d3448 Remove Checkout Registration Module and Simplify Checkout Flow
- Deleted the CheckoutRegistrationModule and its associated components, streamlining the checkout process to require user authentication before proceeding.
- Updated the app.module.ts and router.config.ts to remove references to the CheckoutRegistrationModule.
- Refactored the checkout flow to utilize the AccountCheckoutContainer for handling user registration and checkout in a single-page flow.
- Enhanced the checkout store to eliminate guest info and registration states, focusing solely on authenticated user data.
- Standardized order types to PascalCase across the application for consistency.
- Updated relevant schemas and documentation to reflect the removal of guest checkout and the new authentication-first approach.
2025-12-23 13:21:29 +09:00

38 lines
1006 B
TypeScript

/**
* Feature Flags Configuration
*
* Controls gradual rollout of new features.
* Initially uses environment variables, can be replaced with a feature flag service.
*/
export const FEATURE_FLAGS = {
/**
* Enable public catalog (browse without login)
*/
PUBLIC_CATALOG: process.env.NEXT_PUBLIC_FEATURE_PUBLIC_CATALOG !== "false",
/**
* Enable unified checkout (authenticated checkout flow)
*/
UNIFIED_CHECKOUT: process.env.NEXT_PUBLIC_FEATURE_UNIFIED_CHECKOUT !== "false",
/**
* Enable public support (FAQ and contact without login)
*/
PUBLIC_SUPPORT: process.env.NEXT_PUBLIC_FEATURE_PUBLIC_SUPPORT !== "false",
} as const;
/**
* Hook to check if a feature is enabled
*/
export function useFeatureFlag(flag: keyof typeof FEATURE_FLAGS): boolean {
return FEATURE_FLAGS[flag];
}
/**
* Check if a feature is enabled (for use outside React components)
*/
export function isFeatureEnabled(flag: keyof typeof FEATURE_FLAGS): boolean {
return FEATURE_FLAGS[flag];
}