feat: body dimensions optional
This commit is contained in:
@@ -13,26 +13,9 @@ class ParticipantValidator extends ConstraintValidator
|
||||
/** @var ParticipantDto $participant */
|
||||
$participant = $value;
|
||||
|
||||
$this->assertBodyMeasurementsValid($participant);
|
||||
$this->assertPickupSelected($participant);
|
||||
}
|
||||
|
||||
public function assertBodyMeasurementsValid(ParticipantDto $participant): void
|
||||
{
|
||||
if (0 === count($participant->rentals)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (['height', 'shoeSize', 'weight'] as $property) {
|
||||
if (empty($participant->{$property})) {
|
||||
$this->context->buildViolation('Bitte angeben wegen Leihmaterial')
|
||||
->atPath($property)
|
||||
->addViolation()
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function assertPickupSelected(ParticipantDto $participant): void
|
||||
{
|
||||
// Check if either outbound or inbound transportation is bus
|
||||
|
||||
Reference in New Issue
Block a user