From 3b8e9e65e75a953b0ab6c6309941506b2c8f385b Mon Sep 17 00:00:00 2001 From: wadedvsa <155439365+wadedvsa@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:19:37 +0100 Subject: [PATCH 1/2] fix: Don't allow deleting pre submission file uploads --- .../Lva/AbstractUploadEvidenceController.php | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php b/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php index b36eac72e..98cd23390 100644 --- a/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php +++ b/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php @@ -8,6 +8,7 @@ use Common\RefData; use Common\Service\Helper\FileUploadHelperService; use Common\Service\Helper\FormHelperService; +use DateTimeImmutable; use Dvsa\Olcs\Transfer\Query\Application\UploadEvidence; use Dvsa\Olcs\Utils\Translation\NiTextTranslation; use Olcs\Controller\Lva\Traits\ApplicationControllerTrait; @@ -287,15 +288,10 @@ public function financialEvidenceProcessFileUpload($file) $this->getFinancialEvidenceData(true); } - /** - * Get list of financial evidence documents - * - * @return array - */ - public function financialEvidenceLoadFileUpload() + /** Get list of financial evidence documents */ + public function financialEvidenceLoadFileUpload(): array { - $financialEvidenceData = $this->getFinancialEvidenceData(); - return $financialEvidenceData['documents']; + return array_filter($this->getFinancialEvidenceData()['documents'], fn($doc) => $doc['isPostSubmissionUpload']); } /** @@ -324,14 +320,10 @@ public function supportingEvidenceProcessFileUpload($file) $this->getData(true); } - /** - * Get list of supporting evidence documents - * - * @return array - */ - public function supportingEvidenceLoadFileUpload() + /** Get list of supporting evidence documents */ + public function supportingEvidenceLoadFileUpload(): array { - return $this->getData()['supportingEvidence']; + return array_filter($this->getData()['supportingEvidence'], fn($doc) => $doc['isPostSubmissionUpload']); } /** From 5b7efa25c4627fd7180afe9525184064877fec61 Mon Sep 17 00:00:00 2001 From: wadedvsa <155439365+wadedvsa@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:21:15 +0100 Subject: [PATCH 2/2] chore: Unused use --- .../Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php b/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php index 98cd23390..aee8bc995 100644 --- a/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php +++ b/module/Olcs/src/Controller/Lva/AbstractUploadEvidenceController.php @@ -8,7 +8,6 @@ use Common\RefData; use Common\Service\Helper\FileUploadHelperService; use Common\Service\Helper\FormHelperService; -use DateTimeImmutable; use Dvsa\Olcs\Transfer\Query\Application\UploadEvidence; use Dvsa\Olcs\Utils\Translation\NiTextTranslation; use Olcs\Controller\Lva\Traits\ApplicationControllerTrait;