feat: expand client jobcard and reporting workflows
This commit is contained in:
@@ -14,6 +14,9 @@ use App\Domain\Jobcard\TimeAggregator;
|
||||
$reference = JobcardReference::generate(42, 2026);
|
||||
if ($reference !== 'JC-2026-000042') throw new RuntimeException('Expected generated jobcard reference.');
|
||||
if (!JobcardReference::isValid($reference) || JobcardReference::isValid('bad-reference')) throw new RuntimeException('Expected reference format validation.');
|
||||
$tooLargeRejected = false;
|
||||
try { JobcardReference::generate(1000000, 2026); } catch (InvalidArgumentException $exception) { $tooLargeRejected = true; }
|
||||
if (!$tooLargeRejected) throw new RuntimeException('Reference sequences above six digits must be rejected.');
|
||||
|
||||
$transitions = new StatusTransitionValidator();
|
||||
if (!$transitions->canTransition('new', 'assigned')) throw new RuntimeException('new should transition to assigned.');
|
||||
|
||||
Reference in New Issue
Block a user