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:
@@ -115,6 +115,9 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
|
||||
if(parameter.CannotHaveInteractions != null && parameter.CannotHaveInteractions.Any())
|
||||
prospectsQuery = prospectsQuery.Where(x => x.Interactions.All(i => !parameter.CannotHaveInteractions.Contains(i.Type)));
|
||||
|
||||
if (!parameter.IncludeDeleted)
|
||||
prospectsQuery = prospectsQuery.Where(x => x.RecordState != RecordState.Deleted);
|
||||
|
||||
var prospects = await prospectsQuery.ToListAsync();
|
||||
|
||||
@@ -172,6 +175,7 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
entityProspect.Name = prospect.Name;
|
||||
entityProspect.FsId = prospect.FsId;
|
||||
entityProspect.Warning = prospect.Warning;
|
||||
entityProspect.RecordState = prospect.RecordState;
|
||||
|
||||
var saveR = await Context.SaveChangesAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user