fix: validate mandatory services selection
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/**
|
||||
* Validates that all mandatory additional services are selected.
|
||||
*
|
||||
* Applied on ParticipantEditDto to enforce mandatory additional services based
|
||||
* on participant age and booking eligibility in both create and edit flows.
|
||||
*/
|
||||
#[\Attribute]
|
||||
class MandatoryAdditionalServicesSelected extends Constraint
|
||||
{
|
||||
public string $message = 'Bitte wähle alle Pflichtleistungen aus.';
|
||||
|
||||
public function getTargets(): array|string
|
||||
{
|
||||
return static::CLASS_CONSTRAINT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user