feat: log uploads by administrative users on behalf of teamers

This commit is contained in:
Björn Fromme
2025-01-08 13:10:14 +01:00
parent f269068b71
commit dad6965494
@@ -8,6 +8,7 @@ use App\Event\DocumentUploadedEvent;
use App\Htmx\HxRedirectResponse;
use App\Service\Upload\UploadHandler;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Target;
use Symfony\Component\HttpFoundation\Request;
@@ -25,6 +26,7 @@ class DocumentUploadController extends AbstractController
#[Target('disposition')]
private readonly WorkflowInterface $workflow,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly LoggerInterface $logger,
) {
}
@@ -96,6 +98,14 @@ class DocumentUploadController extends AbstractController
$this->uploadHandler->destroyUploadSession();
$this->eventDispatcher->dispatch(new DocumentUploadedEvent($upload), DocumentUploadedEvent::NAME);
$this->logger->info('Document upload for teamer', [
'teamer_id' => $teamer->getId(),
'teamer_name' => $teamer->getFullName(),
'disposition_id' => $disposition->getId(),
'document_id' => $upload->getId(),
'upload_type' => $uploadType,
]);
}
private function getRedirectResponse(Disposition $disposition): HxRedirectResponse