Fill the task calendar's working days in order instead of evenly
A task's estimate now takes each working day of its planned period up to the assignee's free capacity before the next day gets anything, so 9 h is booked as 7.5 h + 1.5 h rather than 4.5 h + 4.5 h. What does not fit in the period still moves past its end and makes the task end later. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -7,11 +7,11 @@ function scheduleDay(string $date): DateTimeImmutable
|
||||
return new DateTimeImmutable($date);
|
||||
}
|
||||
|
||||
it('splits the estimate evenly over the working days of the period', function () {
|
||||
it('fills the working days of the period in order', function () {
|
||||
// Fri 4.12.2026 – Tue 8.12.2026; the weekend in between gets nothing.
|
||||
$schedule = TaskScheduler::schedule(scheduleDay('2026-12-04'), scheduleDay('2026-12-08'), 600, [], 480, []);
|
||||
|
||||
expect($schedule->minutesByDay)->toBe(['2026-12-04' => 210, '2026-12-07' => 195, '2026-12-08' => 195])
|
||||
expect($schedule->minutesByDay)->toBe(['2026-12-04' => 480, '2026-12-07' => 120])
|
||||
->and($schedule->end->format('Y-m-d'))->toBe('2026-12-08')
|
||||
->and($schedule->extended)->toBeFalse();
|
||||
});
|
||||
@@ -21,7 +21,7 @@ it('skips holidays and uses weekend days when the period has nothing else', func
|
||||
$weekend = TaskScheduler::schedule(scheduleDay('2026-12-05'), scheduleDay('2026-12-06'), 300, [], 480, []);
|
||||
|
||||
expect($overHolidays->minutesByDay)->toBe(['2026-12-28' => 240])
|
||||
->and($weekend->minutesByDay)->toBe(['2026-12-05' => 150, '2026-12-06' => 150]);
|
||||
->and($weekend->minutesByDay)->toBe(['2026-12-05' => 300]);
|
||||
});
|
||||
|
||||
it('moves what does not fit to the next working days and ends later', function () {
|
||||
|
||||
Reference in New Issue
Block a user