wip: submit booking to api

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent ee264e88d4
commit 7ea52670b9
34 changed files with 3316 additions and 31 deletions
@@ -16,6 +16,7 @@ class ParticipantValidator extends ConstraintValidator
$this->assertBodyMeasurementsValid($participant);
$this->assertTransportationSelected($participant);
$this->assertPickupSelected($participant);
$this->assertApplicantAddressValid($participant);
}
public function assertBodyMeasurementsValid(ParticipantDto $participant): void
@@ -64,4 +65,49 @@ 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()
;
}
}
}