Restrict results-close rollback to players with suggestions

This commit is contained in:
2026-02-08 14:54:12 +01:00
parent 0c888e5a5d
commit 02d15e9c50
5 changed files with 41 additions and 3 deletions

View File

@@ -21,7 +21,12 @@ internal sealed class AdminWorkflowService(AppDbContext db)
}
else
{
await db.Players.ExecuteUpdateAsync(p => p.SetProperty(x => x.CurrentPhase, Phase.Vote).SetProperty(x => x.VotesFinal, false));
await db.Players
.Where(p => p.Suggestions.Any())
.ExecuteUpdateAsync(p => p.SetProperty(x => x.CurrentPhase, Phase.Vote).SetProperty(x => x.VotesFinal, false));
await db.Players
.Where(p => !p.Suggestions.Any())
.ExecuteUpdateAsync(p => p.SetProperty(x => x.CurrentPhase, Phase.Suggest).SetProperty(x => x.VotesFinal, false));
}
await db.SaveChangesAsync();