wip: email uniqueness validation

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent 54a3145710
commit 89979d6ce4
11 changed files with 549 additions and 783 deletions
@@ -6,6 +6,7 @@ namespace App\Controller\Booking\Traits;
use App\Form\BookingParticipantType;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantEditDto;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -61,12 +62,18 @@ trait ParticipantCardFlowTrait
throw new \InvalidArgumentException(sprintf('Participant at index %d does not exist', $index));
}
// Create wrapper DTO for email uniqueness validation
$wrapper = new ParticipantEditDto(
participant: $participant,
bookingContext: $bookingDto,
);
// Merge default options with provided options
$formOptions = array_merge([
'booking_context' => $bookingDto,
], $options);
return $this->createForm(BookingParticipantType::class, $participant, $formOptions);
return $this->createForm(BookingParticipantType::class, $wrapper, $formOptions);
}
/**