Add the quoted amount and completion time to customer jobs

- Jobs get a budget / quoted amount (cents, VAT 0). Only users who may
  see quotes see and edit it on the job form and page, and only they see
  its changes in the history. Others' saves keep the stored amount: the
  server decides whether the amount is set, not the browser.
- Jobs record when they were done: set when a job first reaches a status
  that locks its hours, kept through the billing statuses, cleared when
  management opens the lock. The billing export will use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 11:46:36 +02:00
co-authored by Claude Opus 5.5
parent d5cbf9d6eb
commit c149c56388
24 changed files with 284 additions and 15 deletions
@@ -10,6 +10,7 @@ use App\Modules\Jobs\Domain\Contracts\CustomerJobRepository;
use App\Modules\Jobs\Domain\Exceptions\CustomerJobNotFound;
use App\Modules\Jobs\Domain\Exceptions\InvalidJobReference;
use App\Modules\Shared\Application\Contracts\TransactionManager;
use App\Modules\Users\Application\Contracts\Clock;
/**
* Changes a customer job and records each changed field in its history.
@@ -21,6 +22,7 @@ final class UpdateCustomerJob
private CustomerJobRepository $jobs,
private JobDetailsFactory $detailsFactory,
private TransactionManager $transactions,
private Clock $clock,
) {}
/**
@@ -33,6 +35,7 @@ final class UpdateCustomerJob
$job = $this->jobs->findById($jobId) ?? throw new CustomerJobNotFound($jobId);
$changes = $job->changeDetails($this->detailsFactory->build($data, $job->details()));
$job->recordCompletion($this->clock->now());
if ($changes === []) {
return;