feat: feature flags for sanitizing and stamping of uploads
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Form\TeamerDispositionType;
|
||||
use App\Model\UploadSessionDto;
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Flagception\Manager\FeatureManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Target;
|
||||
@@ -31,7 +32,8 @@ class DetailController extends AbstractController
|
||||
#[Target('disposition')]
|
||||
private readonly WorkflowInterface $workflow,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly LoggerInterface $logger
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly FeatureManagerInterface $featureManager,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -88,7 +90,10 @@ class DetailController extends AbstractController
|
||||
|
||||
$this->uploadHandler->moveUploadSessionFilesFromOrphanage(Upload::TYPE_CONTRACT, $uploadSession);
|
||||
$this->uploadHandler->destroyUploadSession();
|
||||
$this->uploadHandler->ensurePdf($upload);
|
||||
|
||||
if (true === $this->featureManager->isActive('sanitize_uploads')) {
|
||||
$this->uploadHandler->ensurePdf($upload);
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
@@ -118,7 +123,10 @@ class DetailController extends AbstractController
|
||||
|
||||
$this->uploadHandler->moveUploadSessionFilesFromOrphanage(Upload::TYPE_INVOICE, $uploadSession);
|
||||
$this->uploadHandler->destroyUploadSession();
|
||||
$this->uploadHandler->ensurePdf($upload);
|
||||
|
||||
if (true === $this->featureManager->isActive('sanitize_uploads')) {
|
||||
$this->uploadHandler->ensurePdf($upload);
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user