Initial commit, project structure and domain models
This commit is contained in:
0
src/api/MicCheck.Api/Features/.gitkeep
Normal file
0
src/api/MicCheck.Api/Features/.gitkeep
Normal file
17
src/api/MicCheck.Api/Features/Feature.cs
Normal file
17
src/api/MicCheck.Api/Features/Feature.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public class Feature
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public required string Name { get; set; }
|
||||
public FeatureType Type { get; set; }
|
||||
public string? InitialValue { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool DefaultEnabled { get; set; }
|
||||
public int ProjectId { get; init; }
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
public ICollection<FeatureState> FeatureStates { get; init; } = [];
|
||||
public ICollection<Tag> Tags { get; init; } = [];
|
||||
}
|
||||
|
||||
public enum FeatureType { Standard, MultiVariate }
|
||||
11
src/api/MicCheck.Api/Features/FeatureSegment.cs
Normal file
11
src/api/MicCheck.Api/Features/FeatureSegment.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public class FeatureSegment
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public int FeatureId { get; init; }
|
||||
public int SegmentId { get; init; }
|
||||
public int EnvironmentId { get; init; }
|
||||
public int Priority { get; set; }
|
||||
public FeatureState? FeatureState { get; set; }
|
||||
}
|
||||
15
src/api/MicCheck.Api/Features/FeatureState.cs
Normal file
15
src/api/MicCheck.Api/Features/FeatureState.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public class FeatureState
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public int FeatureId { get; init; }
|
||||
public int EnvironmentId { get; init; }
|
||||
public int? IdentityId { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string? Value { get; set; }
|
||||
public int? FeatureSegmentId { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
public DateTimeOffset UpdatedAt { get; set; }
|
||||
public int Version { get; set; }
|
||||
}
|
||||
8
src/api/MicCheck.Api/Features/FeatureStateResult.cs
Normal file
8
src/api/MicCheck.Api/Features/FeatureStateResult.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public class FeatureStateResult
|
||||
{
|
||||
public required Feature Feature { get; init; }
|
||||
public bool Enabled { get; init; }
|
||||
public string? Value { get; init; }
|
||||
}
|
||||
9
src/api/MicCheck.Api/Features/Tag.cs
Normal file
9
src/api/MicCheck.Api/Features/Tag.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public class Tag
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public required string Label { get; set; }
|
||||
public required string Color { get; set; }
|
||||
public int ProjectId { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user