Template
chore: deploy initial code base
This commit is contained in:
@@ -0,0 +1,347 @@
|
||||
# Feature Flag Usage Documentation - IFeatureFlagServiceClient.IsEnabledAsync
|
||||
|
||||
This document provides a comprehensive overview of all feature flags used throughout the Continuous Improvement codebase via the `IFeatureFlagServiceClient.IsEnabledAsync` method.
|
||||
|
||||
## Overview
|
||||
|
||||
The application uses feature flags to control functionality on a per-client basis in this multi-tenant system. Feature flags are checked using the `IFeatureFlagServiceClient` service and are typically scoped to a specific database GUID.
|
||||
|
||||
### Feature Flag Index
|
||||
|
||||
| # | Feature Flag | Description | Section |
|
||||
|---|--------------|-------------|---------|
|
||||
| 1 | `ciflexibleexplorationenabled` | Controls access to flexible exploration features for non-SDT employees | [Section 1](#1-ciflexibleexplorationenabled) |
|
||||
| 2 | `enableencounteropportunityintempo` | Controls whether encounter opportunities are enabled in the Tempo interface | [Section 2](#2-enableencounteropportunityintempo) |
|
||||
| 3 | `ciflexibleexplorationpage3enabled` | Controls access to the flexible exploration information page (third page) | [Section 3](#3-ciflexibleexplorationpage3enabled) |
|
||||
| 4 | `enablepayrollopportunityintempo` | Controls whether payroll opportunities are enabled in the Tempo interface | [Section 4](#4-enablepayrollopportunityintempo) |
|
||||
| 5 | `chargecodebeta` | Controls access to charge code beta features | [Section 5](#5-chargecodebeta) |
|
||||
| 6 | `cibenchmarkingenabled` | Controls benchmarking features in continuous improvement | [Section 6](#6-cibenchmarkingenabled) |
|
||||
| 7 | `ciopportunityworkbooks` | Controls opportunity workbook features | [Section 7](#7-ciopportunityworkbooks) |
|
||||
| 8 | `networkopportunitiesenabled` | Controls network opportunity features | [Section 8](#8-networkopportunitiesenabled) |
|
||||
| 9 | `strategicopportunityforchargecode` | Controls strategic opportunity features specifically for charge codes | [Section 9](#9-strategicopportunityforchargecode) |
|
||||
| 10 | `ciexplorationpopulationmanagementlaunchesstrategicopportunitywizard` | Controls if the Add Opportunity button on the Exploration Population page launches the Strategic Opportunity Wizard |
|
||||
## Feature Flag Keys and Usage
|
||||
|
||||
### 1. "ciflexibleexplorationenabled"
|
||||
**Purpose**: Controls access to flexible exploration features for non-SDT employees
|
||||
|
||||
**Usage Locations**:
|
||||
- `AllOpportunitiesController.cs` (line 40)
|
||||
- `ExplorationOpportunitiesController.cs` (line 45)
|
||||
|
||||
**Implementation Pattern**:
|
||||
```csharp
|
||||
// C# example
|
||||
public async Task<IActionResult> SomeAction()
|
||||
{
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("ciflexibleexplorationenabled"))
|
||||
{
|
||||
// Code for flexible exploration features
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback or default behavior
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables flexible exploration functionality. SDT employees always have access, while client users need this feature flag enabled.
|
||||
|
||||
---
|
||||
|
||||
### 2. "enableencounteropportunityintempo"
|
||||
**Purpose**: Controls whether encounter opportunities are enabled in the Tempo interface
|
||||
|
||||
**Usage Locations**:
|
||||
- `EncounterOpportunitiesController.cs` (lines 90, 175)
|
||||
|
||||
**Implementation Pattern**:
|
||||
```csharp
|
||||
// C# example
|
||||
public async Task<IActionResult> TempoAction()
|
||||
{
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("enableencounteropportunityintempo"))
|
||||
{
|
||||
// Code for encounter opportunities in Tempo
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to Jazz interface or show message
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Feature flag to enable encounter opportunity functionality in the modern Tempo interface versus legacy Jazz interface.
|
||||
|
||||
---
|
||||
|
||||
### 3. "ciflexibleexplorationpage3enabled"
|
||||
**Purpose**: Controls access to the flexible exploration information page (third page)
|
||||
|
||||
**Usage Locations**:
|
||||
- `ExplorationController.cs` (line 45)
|
||||
|
||||
**Implementation Pattern**:
|
||||
```csharp
|
||||
// C# example
|
||||
public async Task<IActionResult> ExplorationPageAction()
|
||||
{
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("ciflexibleexplorationpage3enabled"))
|
||||
{
|
||||
// Code for the third page of flexible exploration
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect or show less data
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables the third page of flexible exploration functionality for enhanced data exploration capabilities.
|
||||
|
||||
---
|
||||
|
||||
### 4. "enablepayrollopportunityintempo"
|
||||
**Purpose**: Controls whether payroll opportunities are enabled in the Tempo interface
|
||||
|
||||
**Usage Locations**:
|
||||
- `PayrollOpportunitiesController.cs` (line 85)
|
||||
|
||||
**Implementation Pattern**:
|
||||
```csharp
|
||||
// C# example
|
||||
public async Task<IActionResult> PayrollTempoAction()
|
||||
{
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("enablepayrollopportunityintempo"))
|
||||
{
|
||||
// Code for payroll opportunities in Tempo
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to other methods or show message
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Feature flag to enable payroll opportunity functionality in the modern Tempo interface.
|
||||
|
||||
---
|
||||
|
||||
### 5. "chargecodebeta"
|
||||
**Purpose**: Controls access to charge code beta features
|
||||
|
||||
**Usage Locations**:
|
||||
- `ChargeCodeOpportunitiesController.cs` (line 243)
|
||||
|
||||
**Implementation Pattern**:
|
||||
```csharp
|
||||
// C# example
|
||||
public async Task<IActionResult> ChargeCodeBetaAction()
|
||||
{
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("chargecodebeta"))
|
||||
{
|
||||
// Code for charge code beta features
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide or disable beta features
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Beta feature flag for charge code opportunities functionality, controlling access to new charge code features.
|
||||
|
||||
---
|
||||
|
||||
### 6. "cibenchmarkingenabled"
|
||||
**Purpose**: Controls benchmarking features in continuous improvement
|
||||
|
||||
**Usage Locations**:
|
||||
- Frontend TypeScript components
|
||||
- Configuration and peer group functionality
|
||||
|
||||
**Implementation Pattern**:
|
||||
```typescript
|
||||
// TypeScript example
|
||||
if (featureFlagService.isEnabled("cibenchmarkingenabled")) {
|
||||
// Code for benchmarking features
|
||||
} else {
|
||||
// Alternative code path
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables benchmarking functionality in the CI application, allowing comparison against peer groups.
|
||||
|
||||
---
|
||||
|
||||
### 7. "ciopportunityworkbooks"
|
||||
**Purpose**: Controls opportunity workbook features
|
||||
|
||||
**Usage Locations**:
|
||||
- Referenced in TypeScript interface definitions
|
||||
- Workbook management components
|
||||
|
||||
**Context**: Feature flag for workbook functionality related to opportunities.
|
||||
|
||||
---
|
||||
|
||||
### 8. "networkopportunitiesenabled"
|
||||
**Purpose**: Controls network opportunity features
|
||||
|
||||
**Usage Locations**:
|
||||
- Frontend navigation and components
|
||||
- Network opportunity controllers
|
||||
|
||||
**Implementation Pattern**:
|
||||
```typescript
|
||||
// TypeScript example
|
||||
if (featureFlagService.isEnabled("networkopportunitiesenabled")) {
|
||||
// Code for network opportunity features
|
||||
} else {
|
||||
// Code for standard opportunities
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables network opportunity functionality for multi-client opportunity management.
|
||||
|
||||
---
|
||||
|
||||
### 9. "strategicopportunityforchargecode"
|
||||
**Purpose**: Controls strategic opportunity features specifically for charge codes
|
||||
|
||||
**Usage Locations**:
|
||||
- Frontend configuration components
|
||||
- Strategic opportunity management
|
||||
|
||||
**Implementation Pattern**:
|
||||
```typescript
|
||||
// TypeScript example
|
||||
if (featureFlagService.isEnabled("strategicopportunityforchargecode")) {
|
||||
// Code for strategic opportunities for charge codes
|
||||
} else {
|
||||
// Fallback code
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables strategic opportunity functionality specifically for charge code-based opportunities.
|
||||
|
||||
---
|
||||
|
||||
### 10. "ciexplorationpopulationmanagementlaunchesstrategicopportunitywizard"
|
||||
**Purpose**: Controls strategic opportunity features specifically for charge codes
|
||||
|
||||
**Usage Locations**:
|
||||
- Frontend configuration components
|
||||
- Strategic opportunity management
|
||||
|
||||
**Implementation Pattern**:
|
||||
```typescript
|
||||
// TypeScript example
|
||||
if (featureFlagService.isEnabled("ciexplorationpopulationmanagementlaunchesstrategicopportunitywizard")) {
|
||||
// Code to launch strategic opportunities wizard
|
||||
} else {
|
||||
// Fallback code
|
||||
}
|
||||
```
|
||||
|
||||
**Context**: Enables the Add Opportunity button on the Exploration Population page to launch the Strategic Opportunity wizard.
|
||||
|
||||
|
||||
## Key Controllers Using Feature Flags
|
||||
|
||||
| Controller | Feature Flags Used | Purpose |
|
||||
|------------|-------------------|---------|
|
||||
| `AllOpportunitiesController` | `ciflexibleexplorationenabled` | Flexible exploration access control |
|
||||
| `ExplorationOpportunitiesController` | `ciflexibleexplorationenabled` | Exploration features |
|
||||
| `ExplorationController` | `ciflexibleexplorationpage3enabled` | Advanced exploration pages |
|
||||
| `EncounterOpportunitiesController` | `enableencounteropportunityintempo` | Tempo interface integration |
|
||||
| `PayrollOpportunitiesController` | `enablepayrollopportunityintempo` | Payroll Tempo integration |
|
||||
| `ChargeCodeOpportunitiesController` | `chargecodebeta` | Beta charge code features |
|
||||
| `SettingsController` | All CI area flags | Global feature management |
|
||||
|
||||
## Frontend Integration
|
||||
|
||||
The frontend TypeScript code integrates with feature flags through:
|
||||
|
||||
- **Navigation Control**: Menu items visibility based on feature flags
|
||||
- **Component Rendering**: Conditional rendering of UI components
|
||||
- **Service Availability**: API service availability checks
|
||||
- **User Interface**: Feature-specific UI elements and workflows
|
||||
|
||||
### Example Frontend Usage
|
||||
```typescript
|
||||
// TypeScript example
|
||||
async function loadOpportunities() {
|
||||
if (await featureFlagService.isEnabled("ciflexibleexplorationenabled")) {
|
||||
// Load flexible exploration opportunities
|
||||
} else {
|
||||
// Load standard opportunities
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Database Scope
|
||||
|
||||
All feature flags are scoped to specific database GUIDs, enabling per-client feature control in the multi-tenant architecture. This allows different clients to have different features enabled based on their subscription level or beta participation.
|
||||
|
||||
## Testing Considerations
|
||||
|
||||
When testing feature flag functionality:
|
||||
|
||||
1. **Mock the `IFeatureFlagServiceClient`** in unit tests
|
||||
2. **Test both enabled and disabled states** for each feature
|
||||
3. **Verify SDT employee bypass logic** where applicable
|
||||
4. **Test database GUID scoping** for multi-tenant scenarios
|
||||
|
||||
### Example Test Mock
|
||||
```csharp
|
||||
// C# example using Moq
|
||||
var featureFlagMock = new Mock<IFeatureFlagServiceClient>();
|
||||
featureFlagMock.Setup(ff => ff.IsEnabledAsync("ciflexibleexplorationenabled"))
|
||||
.ReturnsAsync(true);
|
||||
|
||||
// Use featureFlagMock.Object in tests
|
||||
```
|
||||
|
||||
## Service Registration
|
||||
|
||||
Feature flags are registered in the dependency injection container via the `IFeatureFlagServiceClient` service, typically configured in the `Startup.cs` or `Program.cs` file for the application.
|
||||
|
||||
## Logging and Monitoring
|
||||
|
||||
Many feature flag checks include structured logging to track usage patterns:
|
||||
|
||||
```csharp
|
||||
// C# example
|
||||
if (await _featureFlagServiceClient.IsEnabledAsync("ciflexibleexplorationenabled"))
|
||||
{
|
||||
_logger.LogInformation("Flexible exploration feature enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogInformation("Flexible exploration feature disabled");
|
||||
}
|
||||
```
|
||||
|
||||
## Maintenance Notes
|
||||
|
||||
- All feature flag keys should be documented when added
|
||||
- Consider feature flag lifecycle and removal strategy for permanent features
|
||||
- Monitor feature flag usage through logging for analysis
|
||||
- Ensure consistent naming conventions for new feature flags
|
||||
- Regularly review and clean up obsolete feature flags
|
||||
- Update this documentation when new feature flags are added
|
||||
|
||||
## Feature Flag Lifecycle
|
||||
|
||||
1. **Development**: New feature flags are added for experimental or beta features
|
||||
2. **Testing**: Features are tested with flags enabled/disabled
|
||||
3. **Rollout**: Gradual enabling of features for specific clients
|
||||
4. **Stabilization**: Features become stable and widely adopted
|
||||
5. **Cleanup**: Feature flags are removed once features are permanent
|
||||
|
||||
---
|
||||
|
||||
*Last Updated: November 2025*
|
||||
*Document Version: 1.0*
|
||||
*Total Feature Flags Documented: 9*
|
||||
Reference in New Issue
Block a user