feat(workflow) : workflows de statuts par projet (kanban custom) #3

Merged
matthieu merged 26 commits from feat/project-workflows into develop 2026-05-20 07:44:10 +00:00
Showing only changes of commit cf94635121 - Show all commits

View File

@@ -478,4 +478,26 @@ class Task
;
}
}
#[Assert\Callback]
public function validateStatusBelongsToProjectWorkflow(ExecutionContextInterface $context): void
{
if (null === $this->status || null === $this->project) {
return;
}
$projectWorkflow = $this->project->getWorkflow();
$statusWorkflow = $this->status->getWorkflow();
if (null === $projectWorkflow || null === $statusWorkflow) {
return;
}
if ($projectWorkflow->getId() !== $statusWorkflow->getId()) {
$context->buildViolation('Status does not belong to this project\'s workflow.')
->atPath('status')
->addViolation()
;
}
}
}