20#ifndef ORES_VARIABILITY_SERVICE_SYSTEM_FLAGS_SERVICE_HPP
21#define ORES_VARIABILITY_SERVICE_SYSTEM_FLAGS_SERVICE_HPP
24#include "ores.utility/log/make_logger.hpp"
25#include "ores.database/domain/context.hpp"
26#include "ores.variability/domain/system_flags.hpp"
27#include "ores.variability/domain/system_flags_cache.hpp"
28#include "ores.variability/service/feature_flags_service.hpp"
30namespace ores::variability::service {
49 inline static std::string_view logger_name =
50 "ores.variability.service.system_flags_service";
52 [[nodiscard]]
static auto& lg() {
54 static auto instance = make_logger(logger_name);
92 [[nodiscard]]
bool is_enabled(domain::system_flag flag)
const;
103 void set_enabled(domain::system_flag flag,
bool enabled,
104 std::string_view recorded_by);
146 void update_cache(domain::system_flag flag,
bool enabled);
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:30
Context for the operations on a postgres database.
Definition context.hpp:30
POD containing cached values of well-known system flags.
Definition system_flags_cache.hpp:34
Service for managing feature flags.
Definition feature_flags_service.hpp:39
Service for accessing well-known system flags with type-safe methods.
Definition system_flags_service.hpp:47
const domain::system_flags_cache & cache() const
Gets a const reference to the cached system flags.
Definition system_flags_service.cpp:47
void set_user_signups(bool enabled, std::string_view recorded_by)
Sets the user signups state.
Definition system_flags_service.cpp:97
bool is_user_signups_enabled() const
Checks if user self-registration (signups) is enabled (from cache).
Definition system_flags_service.cpp:93
void refresh()
Refreshes the cache by reading all system flags from the database.
Definition system_flags_service.cpp:30
bool is_enabled(domain::system_flag flag) const
Checks if a system flag is enabled (from cache).
Definition system_flags_service.cpp:51
bool is_bootstrap_mode_enabled() const
Checks if the system is in bootstrap mode (from cache).
Definition system_flags_service.cpp:84
void set_enabled(domain::system_flag flag, bool enabled, std::string_view recorded_by)
Sets a system flag's enabled state.
Definition system_flags_service.cpp:64
void set_bootstrap_mode(bool enabled, std::string_view recorded_by)
Sets the bootstrap mode state.
Definition system_flags_service.cpp:88