feat: Introduce app feature flags

This commit refactors the application settings to include a new `AppFeatures` interface. This allows for granular control over which features are enabled for the application.

The `AppFeatures` object includes boolean flags for:
- `multiCondo`: Enables or disables the multi-condominium management feature.
- `tickets`: Placeholder for future ticket system integration.
- `payPal`: Enables or disables PayPal payment gateway integration.
- `notices`: Enables or disables the display and management of notices.

These flags are now fetched and stored in the application state, influencing UI elements and logic across various pages to conditionally render features based on their enabled status. For example, the multi-condo selection in `Layout.tsx` and the notice display in `FamilyList.tsx` are now gated by these feature flags. The `FamilyDetail.tsx` page also uses the `payPal` flag to conditionally enable the PayPal payment option.

The `SettingsPage.tsx` has been updated to include a new 'features' tab for managing these flags.
This commit is contained in:
2025-12-07 20:21:01 +01:00
parent 5311400615
commit 919be985c9
8 changed files with 243 additions and 67 deletions

View File

@@ -46,6 +46,13 @@ export interface SmtpConfig {
fromEmail: string;
}
export interface AppFeatures {
multiCondo: boolean;
tickets: boolean;
payPal: boolean;
notices: boolean;
}
export interface AlertDefinition {
id: string;
subject: string;
@@ -80,6 +87,7 @@ export interface AppSettings {
// Global settings only
currentYear: number; // The active fiscal year (could be per-condo, but global for simplicity now)
smtpConfig?: SmtpConfig;
features: AppFeatures;
}
export enum PaymentStatus {