Add flagsmith

This commit is contained in:
2025-12-11 19:22:54 +07:00
parent 65d00c0b9a
commit 35df25915f
6 changed files with 187 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
namespace Managing.Application.Abstractions.Services;
/// <summary>
/// Interface for Flagsmith feature flag service
/// </summary>
public interface IFlagsmithService
{
/// <summary>
/// Gets flags for a specific user identity
/// </summary>
/// <param name="identity">The user identity identifier</param>
/// <returns>Flags object for the identity</returns>
Task<IFlagsmithFlags> GetIdentityFlagsAsync(string identity);
/// <summary>
/// Checks if a feature is enabled for a specific identity
/// </summary>
/// <param name="identity">The user identity identifier</param>
/// <param name="featureName">The name of the feature flag</param>
/// <returns>True if the feature is enabled</returns>
Task<bool> IsFeatureEnabledAsync(string identity, string featureName);
/// <summary>
/// Gets the feature value for a specific identity
/// </summary>
/// <param name="identity">The user identity identifier</param>
/// <param name="featureName">The name of the feature flag</param>
/// <returns>The feature value as string</returns>
Task<string?> GetFeatureValueAsync(string identity, string featureName);
}
/// <summary>
/// Wrapper interface for Flagsmith flags to enable testing
/// </summary>
public interface IFlagsmithFlags
{
Task<bool> IsFeatureEnabled(string featureName);
Task<string?> GetFeatureValue(string featureName);
}