Add machines with day-by-day work lists for job tasks

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:43:55 +02:00
co-authored by Claude Sonnet 5.5
parent 0de0e332b2
commit aac579257a
59 changed files with 3803 additions and 1 deletions
@@ -12,6 +12,7 @@ use App\Modules\Jobs\Domain\Contracts\TaskRepository;
use App\Modules\Jobs\Domain\Entities\Task;
use App\Modules\Jobs\Domain\Enums\TaskStatus;
use App\Modules\Jobs\Domain\Events\PeopleAddedToTask;
use App\Modules\Jobs\Domain\Events\TaskCompleted;
use App\Modules\Jobs\Domain\Exceptions\CustomerJobNotFound;
use App\Modules\Jobs\Domain\Exceptions\InvalidTaskReference;
use App\Modules\Jobs\Domain\Exceptions\PlanEndsBeforeStart;
@@ -49,6 +50,7 @@ final class UpdateTask
$before = self::planningInput($task);
$peopleBefore = PeopleAddedToTask::peopleOf($task);
$wasDone = $task->status() === TaskStatus::Done;
$task->changeDetails(
$data->workTypeId,
@@ -75,6 +77,10 @@ final class UpdateTask
if ($added !== null) {
$this->events->dispatch($added);
}
if (! $wasDone && $task->status() === TaskStatus::Done) {
$this->events->dispatch(new TaskCompleted($taskId, $jobId));
}
});
}