mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
Move the logic to check if dest users are required to a dedicated constraint
- Create a dedicated constraint to check if the destUsers are required by the applied transition. - Apply on WorkflowTransitionContextDTO and, if required, use the built-in constraints - create tests
This commit is contained in:
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\UserGroup;
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Workflow\Validator\TransitionHasDestineeIfIsSentExternal;
|
||||
use Chill\MainBundle\Workflow\Validator\TransitionHasDestUserIfRequired;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\ThirdPartyBundle\Validator\ThirdPartyHasEmail;
|
||||
@@ -26,6 +27,7 @@ use Symfony\Component\Workflow\Transition;
|
||||
* Context for a transition on an workflow entity.
|
||||
*/
|
||||
#[TransitionHasDestineeIfIsSentExternal]
|
||||
#[TransitionHasDestUserIfRequired]
|
||||
class WorkflowTransitionContextDTO
|
||||
{
|
||||
/**
|
||||
@@ -81,6 +83,7 @@ class WorkflowTransitionContextDTO
|
||||
])]
|
||||
public array $futureDestineeEmails = [];
|
||||
|
||||
#[Assert\NotNull]
|
||||
public ?Transition $transition = null;
|
||||
|
||||
public string $comment = '';
|
||||
|
Reference in New Issue
Block a user