wip: modernized edit flow

This commit is contained in:
Björn Fromme
2025-10-08 21:09:53 +02:00
parent c3008d7f7a
commit cba0f747cd
75 changed files with 1662 additions and 747 deletions
@@ -16,7 +16,6 @@ class ParticipantValidator extends ConstraintValidator
$this->assertBodyMeasurementsValid($participant);
$this->assertTransportationSelected($participant);
$this->assertPickupSelected($participant);
$this->assertApplicantAddressValid($participant);
}
public function assertBodyMeasurementsValid(ParticipantDto $participant): void
@@ -68,49 +67,4 @@ class ParticipantValidator extends ConstraintValidator
;
}
}
public function assertApplicantAddressValid(ParticipantDto $participant): void
{
// Address is only mandatory for the applicant (first participant)
if (false === $participant->isApplicant()) {
return;
}
// Check each required address field for applicant
if (null === $participant->address->street || '' === trim($participant->address->street)) {
$this->context->buildViolation('Bitte angeben')
->atPath('address.street')
->addViolation()
;
}
if (null === $participant->address->postCode || '' === trim($participant->address->postCode)) {
$this->context->buildViolation('Bitte angeben')
->atPath('address.postCode')
->addViolation()
;
}
if (null === $participant->address->city || '' === trim($participant->address->city)) {
$this->context->buildViolation('Bitte angeben')
->atPath('address.city')
->addViolation()
;
}
if (null === $participant->address->country || '' === trim($participant->address->country)) {
$this->context->buildViolation('Bitte angeben')
->atPath('address.country')
->addViolation()
;
}
// Mobile/phone is mandatory for applicant
if (null === $participant->mobile || '' === trim($participant->mobile)) {
$this->context->buildViolation('Bitte angeben')
->atPath('mobile')
->addViolation()
;
}
}
}