Skip to content

Commit a9349a7

Browse files
committed
only auto-remove non-manually added rosters and not turn 20
1 parent 386c11c commit a9349a7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Snittlistan.Web/Areas/V2/Controllers/RosterController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ public ActionResult Create(CreateRosterViewModel vm)
183183
vm.Opponent,
184184
ParseDate(vm.Date),
185185
vm.IsFourPlayer,
186-
new OilPatternInformation(vm.OilPatternName!, vm.OilPatternUrl!));
186+
new OilPatternInformation(vm.OilPatternName!, vm.OilPatternUrl!))
187+
{
188+
ManuallyAdded = true
189+
};
187190
CompositionRoot.DocumentSession.Store(roster);
188191
return RedirectToAction("Index");
189192
}

Snittlistan.Web/Areas/V2/Domain/Roster.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public string? TeamLevel
116116
public List<AuditLogEntry> AuditLogEntries { get; }
117117
public int Version => AuditLogEntries.Count;
118118
public bool Preliminary { get; set; }
119+
public bool ManuallyAdded { get; set; }
119120

120121
public List<string> Players { get; set; } = new List<string>();
121122

Snittlistan.Web/Commands/GetRostersFromBitsCommandHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public override async Task Handle(HandlerContext<Command> context)
138138
Roster[] toRemove = rosters
139139
.Where(x => foundMatchIds.Contains(x.BitsMatchId) == false
140140
&& x.MatchResultId is null
141-
&& x.Turn <= 20)
141+
&& x.Turn < 20
142+
&& x.ManuallyAdded == false)
142143
.ToArray();
143144
if (toRemove.Any())
144145
{

0 commit comments

Comments
 (0)