- Introduced ServicesCdcSubscriber for handling Salesforce Change Data Capture events, enabling real-time updates for product and account eligibility changes. - Developed utility functions for building SOQL queries related to services, enhancing data retrieval capabilities. - Created base service classes for internet, SIM, and VPN offerings, improving code organization and maintainability. - Implemented ServicesCacheService for efficient caching and invalidation of service data, leveraging CDC for real-time updates. - Enhanced existing service components to utilize new caching mechanisms and ensure data consistency across the application.
38 lines
1018 B
TypeScript
38 lines
1018 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 services browsing (browse without login)
|
|
*/
|
|
PUBLIC_SERVICES: process.env.NEXT_PUBLIC_FEATURE_PUBLIC_SERVICES !== "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];
|
|
}
|