Service Layer medium complexity backend
3
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Backend service exposing REST endpoints for reading and updating organization-level feature flags. Serves the flag map to the Flutter mobile app at login and handles admin portal writes. Enforces RBAC so only Org Admins and Global Admins can mutate flags.

Feature: Feature Toggles

feature-flag-service

Responsibilities

  • Expose GET /api/v1/organizations/:id/feature-flags returning the full flag map
  • Expose PATCH /api/v1/organizations/:id/feature-flags/:key for toggling individual flags
  • Allow Global Admin to set default flag states applied to all organizations
  • Validate flag keys against the shared constants file to prevent drift
  • Enforce role-based authorization on all mutation endpoints

Interfaces

getFeatureFlags(organizationId): Record<string, boolean>
updateFeatureFlag(organizationId, flagKey, enabled): FeatureFlag
getDefaultFlags(): Record<string, boolean>
setDefaultFlag(flagKey, enabled): void
validateFlagKey(key): boolean
bulkResetToDefaults(organizationId): void

Relationships

Dependencies (3)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component