Add RecordState handling for prospects and support soft deletion

Introduced the RecordState property to manage the state of prospects, enabling soft deletion and restoration. Updated related database migrations, UI interactions, and filtering logic to accommodate this addition. Also included automatic database migration at runtime to ensure schema compatibility.
This commit is contained in:
Andre Beging
2025-03-29 13:49:47 +01:00
parent 16023a89e9
commit c2de397a0f
15 changed files with 404 additions and 33 deletions

View File

@@ -17,7 +17,7 @@ namespace FoodsharingSiegen.Contracts.Entity
/// The save profile audit type
/// </summary>
SaveProfile = 10,
#region Usermanagement
@@ -93,11 +93,11 @@ namespace FoodsharingSiegen.Contracts.Entity
public enum ProspectStateFilter
{
All = 0,
OnBoarding = 10,
Verification = 20,
Completed = 30
}
@@ -127,6 +127,16 @@ namespace FoodsharingSiegen.Contracts.Entity
Ambassador = 400
}
/// <summary>
/// Represents the state of a record within the system.
/// </summary>
public enum RecordState
{
Default = 10,
Deleted = 20
}
/// <summary>
/// The fs network type enum
/// </summary>
@@ -202,12 +212,12 @@ namespace FoodsharingSiegen.Contracts.Entity
/// The complete interaction type
/// </summary>
Complete = 70,
/// <summary>
/// The StepInBriefing interaction type
/// </summary>
StepInBriefing = 80,
/// <summary>
/// The StepInBriefing interaction type
/// </summary>

View File

@@ -47,6 +47,11 @@ namespace FoodsharingSiegen.Contracts.Entity
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the state of the record within the system.
/// </summary>
public RecordState RecordState { get; set; }
/// <summary>
/// Gets or sets the value of the warning (ab)
/// </summary>

View File

@@ -5,5 +5,5 @@ namespace FoodsharingSiegen.Contracts.Model
/// <summary>
/// The get prospects parameter
/// </summary>
public record GetProspectsParameter(List<InteractionType>? MustHaveInteractions = null, List<InteractionType>? CannotHaveInteractions = null);
public record GetProspectsParameter(List<InteractionType>? MustHaveInteractions = null, List<InteractionType>? CannotHaveInteractions = null, bool IncludeDeleted = false);
}