Give tasks one assignee and members, and schedule template tasks to due dates

- A task now has one optional assignee (tasks.assignee_user_id), whose
  calendar row it is on and whose days its estimate books, and members
  (task_members) who see it among their own jobs and in the weekly sheet
  but get no bookings. A migration moves existing assignees over: the one
  with most booked time becomes the assignee, the others members.
- Adding tasks from a workflow template asks for each step's assignee and,
  by default, schedules tasks with a due date to end on it, booking the
  estimate backwards from the due date (not before today); what does not
  fit runs past the due date and is reported as late.
- The task calendar leaves quick sale tasks out of the unscheduled list,
  shows a bar's job details in a popover on hover and focus, and shows the
  day load on its own grid line.
- The template table stacks its cells on narrow screens to reflow at 320 px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 19:01:11 +02:00
co-authored by Claude Opus 5.5
parent b4f2f1cfaa
commit 18598cc08e
45 changed files with 1133 additions and 248 deletions
@@ -13,7 +13,8 @@ use Illuminate\Database\Eloquent\Model;
/**
* Persistence model of a task, used only inside the Jobs Infrastructure
* layer. Assignees are in task_assignees, day bookings in task_bookings.
* layer. Members are in task_members, the assignee's day bookings in
* task_bookings.
*
* @property int $id
* @property int $customer_job_id
@@ -25,10 +26,11 @@ use Illuminate\Database\Eloquent\Model;
* @property CarbonImmutable|null $planned_from
* @property CarbonImmutable|null $planned_to
* @property string|null $estimated_hours
* @property int|null $assignee_user_id
* @property int $created_by
*/
#[Table('tasks')]
#[Fillable(['customer_job_id', 'work_type_id', 'title', 'description', 'status', 'due_on', 'planned_from', 'planned_to', 'estimated_hours', 'created_by'])]
#[Fillable(['customer_job_id', 'work_type_id', 'title', 'description', 'status', 'due_on', 'planned_from', 'planned_to', 'estimated_hours', 'assignee_user_id', 'created_by'])]
#[UseFactory(TaskFactory::class)]
class TaskModel extends Model
{
@@ -47,6 +49,7 @@ class TaskModel extends Model
'due_on' => 'immutable_date',
'planned_from' => 'immutable_date',
'planned_to' => 'immutable_date',
'assignee_user_id' => 'integer',
'created_by' => 'integer',
];
}