Refactor GenerateGridCommandHandler and GridPlanner for improved slot management and readability
Updated the GenerateGridCommandHandler to streamline slot removal during grid generation by introducing a new RemoveAllSlots method. Enhanced the GridPlanner class by refactoring the FillDay method to utilize a SlotTarget struct for better clarity and organization. These changes improve code maintainability and readability while ensuring efficient slot handling across grid generation processes.
This commit is contained in:
+3
-3
@@ -212,9 +212,9 @@ public sealed class ValidateTemplateQueryHandler(
|
||||
{
|
||||
var slots = layers.SelectMany(l => l.Slots).ToList();
|
||||
|
||||
foreach (var weekday in GridCoverage.Week)
|
||||
foreach (var (from, to) in GridCoverage.Gaps(slots, weekday, dayStart))
|
||||
yield return Gap(weekday, from, to, dayStart);
|
||||
return from weekday in GridCoverage.Week
|
||||
from gap in GridCoverage.Gaps(slots, weekday, dayStart)
|
||||
select Gap(weekday, gap.From, gap.To, dayStart);
|
||||
}
|
||||
|
||||
private static TemplateIssueDto Gap(int weekday, int from, int to, TimeOnly dayStart)
|
||||
|
||||
Reference in New Issue
Block a user