From 93ab86ec317a4792a91d33f77a206140dbbcca24 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Thu, 29 May 2025 14:51:23 +0200 Subject: [PATCH] Validate against new submissions for calls not in_calling status --- src/Dto/Matchfunding/MatchCallSubmissionCreationDto.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Dto/Matchfunding/MatchCallSubmissionCreationDto.php b/src/Dto/Matchfunding/MatchCallSubmissionCreationDto.php index 9299538..b07c337 100644 --- a/src/Dto/Matchfunding/MatchCallSubmissionCreationDto.php +++ b/src/Dto/Matchfunding/MatchCallSubmissionCreationDto.php @@ -14,6 +14,10 @@ class MatchCallSubmissionCreationDto * The MatchCall to which this MatchCallSubmission belongs to. */ #[Assert\NotBlank()] + #[Assert\Expression( + expression: 'value.status === enum("App\\\Entity\\\Matchfunding\\\MatchCallStatus::InCalling")', + message: 'MatchCallSubmissions can only relate to a MatchCall with `in_calling` status.' + )] public MatchCallApiResource $call; /**