feat: log uploads by administrative users on behalf of teamers
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Event\DocumentUploadedEvent;
|
|||||||
use App\Htmx\HxRedirectResponse;
|
use App\Htmx\HxRedirectResponse;
|
||||||
use App\Service\Upload\UploadHandler;
|
use App\Service\Upload\UploadHandler;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\DependencyInjection\Attribute\Target;
|
use Symfony\Component\DependencyInjection\Attribute\Target;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -25,6 +26,7 @@ class DocumentUploadController extends AbstractController
|
|||||||
#[Target('disposition')]
|
#[Target('disposition')]
|
||||||
private readonly WorkflowInterface $workflow,
|
private readonly WorkflowInterface $workflow,
|
||||||
private readonly EventDispatcherInterface $eventDispatcher,
|
private readonly EventDispatcherInterface $eventDispatcher,
|
||||||
|
private readonly LoggerInterface $logger,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +98,14 @@ class DocumentUploadController extends AbstractController
|
|||||||
$this->uploadHandler->destroyUploadSession();
|
$this->uploadHandler->destroyUploadSession();
|
||||||
|
|
||||||
$this->eventDispatcher->dispatch(new DocumentUploadedEvent($upload), DocumentUploadedEvent::NAME);
|
$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
|
private function getRedirectResponse(Disposition $disposition): HxRedirectResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user