fix: promote called-off status of assignment to potential dispositions
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Controller\Administrative\Assignment;
|
namespace App\Controller\Administrative\Assignment;
|
||||||
|
|
||||||
use App\Entity\Assignment;
|
use App\Entity\Assignment;
|
||||||
|
use App\Entity\Disposition;
|
||||||
use App\Event\AssignmentCalledOffEvent;
|
use App\Event\AssignmentCalledOffEvent;
|
||||||
use App\Htmx\HxRedirectResponse;
|
use App\Htmx\HxRedirectResponse;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@@ -19,7 +20,7 @@ class CallOffController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private readonly EventDispatcherInterface $eventDispatcher,
|
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')) {
|
if (true === $request->isMethod('POST')) {
|
||||||
$assignment->setStatus(Assignment::STATUS_CALLED_OFF);
|
$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->entityManager->flush();
|
||||||
|
|
||||||
$this
|
$this
|
||||||
|
|||||||
Reference in New Issue
Block a user