Add customer job Kanban board
Phase 1, item 6: - New page /jobs/board: one column per Kanban status (archived left out), one card per job with number, name, customer, priority and due date. Filters for my jobs (default), priority and service unit; subcontractors see only their own cards and cannot move them. - Cards move by dragging (Livewire wire:sort across column groups) or with each card's status select, which works with the keyboard. Moves go through ChangeJobStatus, so they are recorded in the job history; the result is announced and focus returns to the moved card. - Billing statuses only for management and the job's biller: the jobs.set-billing-status gate now takes the biller's user id. - Column links with counts at the top; columns wrap with the screen width, so there is no sideways scrolling. - CustomerJobQueries::board() and the biller on job summaries. - Menu link and a link from the job list; spec and CLAUDE.md updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Modules\Jobs\Infrastructure\Providers;
|
||||
use App\Models\User;
|
||||
use App\Modules\Customers\Application\Contracts\CustomerRowUsage;
|
||||
use App\Modules\Jobs\Application\Contracts\CustomerJobQueries;
|
||||
use App\Modules\Jobs\Application\DTOs\CustomerJobDetails;
|
||||
use App\Modules\Jobs\Domain\Contracts\CustomerJobRepository;
|
||||
use App\Modules\Jobs\Domain\Contracts\JobNumberSequence;
|
||||
use App\Modules\Jobs\Infrastructure\CustomerRowUsageFromJobs;
|
||||
@@ -57,7 +56,8 @@ class JobsServiceProvider extends ServiceProvider
|
||||
Gate::define('jobs.archive', $isManager);
|
||||
|
||||
// "Lasku luotu" and "Laskutettu" are set when invoicing: management or the job's biller.
|
||||
Gate::define('jobs.set-billing-status', fn (User $user, ?CustomerJobDetails $job = null): bool => $isManager($user)
|
||||
|| ($job !== null && $job->biller?->id === $user->id));
|
||||
// The argument is the job's biller (user id), when known.
|
||||
Gate::define('jobs.set-billing-status', fn (User $user, ?int $billerUserId = null): bool => $isManager($user)
|
||||
|| ($billerUserId !== null && $billerUserId === $user->id));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user