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:
@@ -156,11 +156,11 @@ it('does not remove a task with time entries', function () {
|
||||
->and(JobStatus::OnHold->locksTime())->toBeFalse();
|
||||
});
|
||||
|
||||
it('books a scheduled task evenly from the working days of its period', function () {
|
||||
it('books a scheduled task by filling the working days of its period in order', function () {
|
||||
$taskId = $this->addTask->execute($this->jobId, new TaskData('Taitto', 11, 'waiting', estimatedHours: '12', assigneeUserId: 10, plannedFrom: '2026-12-04', plannedTo: '2026-12-07'), 10);
|
||||
$oneDayId = $this->addTask->execute($this->jobId, new TaskData('Palaveri', 91, 'waiting', assigneeUserId: 10, plannedFrom: '2026-12-08'), 10);
|
||||
|
||||
expect($this->bookings->of($taskId, 10))->toBe(['2026-12-04' => 360, '2026-12-07' => 360])
|
||||
expect($this->bookings->of($taskId, 10))->toBe(['2026-12-04' => 480, '2026-12-07' => 240])
|
||||
->and($this->tasks->findForJob($this->jobId, $oneDayId)?->plannedTo()?->format('Y-m-d'))->toBe('2026-12-08')
|
||||
->and($this->bookings->of($oneDayId, 10))->toBe([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user