Removed services and actions related to team account deletion as well as updated paths within other dependent files, better reflecting their new locations. Also, added a new service titled 'AccountBillingService' for handling billing-related operations and restructured the form layout and handled translation in 'team-account-danger-zone' component.
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
const FeatureFlagsSchema = z.object({
|
|
enableThemeSwitcher: z.boolean(),
|
|
enableAccountDeletion: z.boolean(),
|
|
enableTeamDeletion: z.boolean(),
|
|
enableTeamAccounts: z.boolean(),
|
|
enableTeamCreation: z.boolean(),
|
|
enablePersonalAccountBilling: z.boolean(),
|
|
enableTeamAccountBilling: z.boolean(),
|
|
});
|
|
|
|
const featuresFlagConfig = FeatureFlagsSchema.parse({
|
|
enableThemeSwitcher: true,
|
|
enableAccountDeletion: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_ACCOUNT_DELETION,
|
|
false,
|
|
),
|
|
enableTeamDeletion: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_TEAM_DELETION,
|
|
false,
|
|
),
|
|
enableTeamAccounts: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS,
|
|
true,
|
|
),
|
|
enableTeamCreation: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_TEAMS_CREATION,
|
|
true,
|
|
),
|
|
enablePersonalAccountBilling: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_BILLING,
|
|
false,
|
|
),
|
|
enableTeamAccountBilling: getBoolean(
|
|
process.env.NEXT_PUBLIC_ENABLE_ORGANIZATION_BILLING,
|
|
false,
|
|
),
|
|
} satisfies z.infer<typeof FeatureFlagsSchema>);
|
|
|
|
export default featuresFlagConfig;
|
|
|
|
function getBoolean(value: unknown, defaultValue: boolean) {
|
|
if (typeof value === 'string') {
|
|
return value === 'true';
|
|
}
|
|
|
|
return defaultValue;
|
|
}
|