ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
feature_flags_service Class Reference

Service for managing feature flags. More...

#include <feature_flags_service.hpp>

Collaboration diagram for feature_flags_service:
Collaboration graph

Public Member Functions

 feature_flags_service (database::context ctx)
 Constructs a feature_flags_service.
 
std::optional< domain::feature_flagsget_feature_flag (const std::string &name)
 Retrieves a single feature flag by name.
 
std::vector< domain::feature_flagsget_all_feature_flags ()
 Retrieves all currently active feature flags.
 
void save_feature_flag (const domain::feature_flags &flag)
 Saves a feature flag.
 
void delete_feature_flag (const std::string &name)
 Logically removes a feature flag.
 

Detailed Description

Service for managing feature flags.

Provides high-level operations for retrieving and modifying feature flags. Encapsulates the underlying repository and handles the bitemporal update logic.

Constructor & Destructor Documentation

◆ feature_flags_service()

Constructs a feature_flags_service.

Parameters
ctxThe database context to be used by the repository.

Member Function Documentation

◆ get_feature_flag()

std::optional< domain::feature_flags > get_feature_flag ( const std::string &  name)

Retrieves a single feature flag by name.

Parameters
nameThe name of the feature flag to retrieve.
Returns
An optional containing the feature flag if found, or std::nullopt.
Here is the caller graph for this function:

◆ get_all_feature_flags()

std::vector< domain::feature_flags > get_all_feature_flags ( )

Retrieves all currently active feature flags.

Returns
A vector of all active feature flags.

◆ save_feature_flag()

void save_feature_flag ( const domain::feature_flags flag)

Saves a feature flag.

Handles the bitemporal update logic: if the flag already exists, it is logically removed (closed) before the new version is written. This ensures a clean update of the feature flag.

Parameters
flagThe feature flag to save.
Here is the caller graph for this function:

◆ delete_feature_flag()

void delete_feature_flag ( const std::string &  name)

Logically removes a feature flag.

Closes the validity period of the feature flag, effectively deleting it from the current view while preserving history.

Parameters
nameThe name of the feature flag to delete.