feat: unify pickup selection

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 0f4b16c194
commit e330626b03
19 changed files with 119 additions and 325 deletions
@@ -54,13 +54,16 @@ class ParticipantValidator extends ConstraintValidator
public function assertPickupSelected(ParticipantDto $participant): void
{
if (
null !== $participant->transportationOutbound
&& 'BUS' === $participant->transportationOutbound->subType
&& null === $participant->pickupOutbound
) {
// Check if either outbound or inbound transportation is bus
$hasOutboundBus = null !== $participant->transportationOutbound
&& 'BUS' === $participant->transportationOutbound->subType;
$hasInboundBus = null !== $participant->transportationInbound
&& 'BUS' === $participant->transportationInbound->subType;
// Require pickup if at least one direction has bus transport
if (($hasOutboundBus || $hasInboundBus) && null === $participant->pickup) {
$this->context->buildViolation('Bitte auswählen')
->atPath('pickupOutbound')
->atPath('pickup')
->addViolation()
;
}