From 0fc7684fc7e48a8c9339c9631ad4b3a952f66b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 22 Jul 2025 16:19:31 +0200 Subject: [PATCH] fix: promote called-off status of assignment to potential dispositions --- .../Administrative/Assignment/CallOffController.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Controller/Administrative/Assignment/CallOffController.php b/src/Controller/Administrative/Assignment/CallOffController.php index a229be6..95b0dff 100644 --- a/src/Controller/Administrative/Assignment/CallOffController.php +++ b/src/Controller/Administrative/Assignment/CallOffController.php @@ -3,6 +3,7 @@ namespace App\Controller\Administrative\Assignment; use App\Entity\Assignment; +use App\Entity\Disposition; use App\Event\AssignmentCalledOffEvent; use App\Htmx\HxRedirectResponse; use Doctrine\ORM\EntityManagerInterface; @@ -19,7 +20,7 @@ class CallOffController extends AbstractController public function __construct( private readonly EntityManagerInterface $entityManager, private readonly EventDispatcherInterface $eventDispatcher, - private readonly LoggerInterface $logger + private readonly LoggerInterface $logger, ) { } @@ -30,6 +31,13 @@ class CallOffController extends AbstractController if (true === $request->isMethod('POST')) { $assignment->setStatus(Assignment::STATUS_CALLED_OFF); + foreach ($assignment->getDispositions() as $disposition) { + $disposition + ->setStatus(Disposition::STATUS_CALLED_OFF) + ->setCalledOffBy(Disposition::CALLED_OFF_BY_OFFICE) + ; + } + $this->entityManager->flush(); $this @@ -52,4 +60,4 @@ class CallOffController extends AbstractController 'assignment' => $assignment, ]); } -} \ No newline at end of file +}