fix: don't require email address from participants under 16

This commit is contained in:
fromme committed 2026-09-01 15:15:58 +02:00
1 parent 98e0cfcf6f
commit f595183c05
11 files changed
+566 -36

No files matched your search

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace App\Form\Service\Condition;
use App\Form\Model\BookingDto;
use App\Form\Service\Contract\FieldConditionInterface;
/**
* Condition that checks whether the booking belongs to an internal agency.
*
* Internal agency bookings are made by staff on behalf of a customer, so they are exempt
* from several rules that protect customer-entered data: personal data stays editable and
* fields that are mandatory for customers may be left blank.
*
* This is the plain flag on its own. FirstParticipantReadOnlyCondition and
* PersonalDataMutabilityCondition also consult it, but combine it with further criteria.
*/
class InternalAgencyBookingCondition implements FieldConditionInterface
{
/**
* Evaluates whether the booking is an internal agency booking.
*
* @param BookingDto $bookingDto The current booking data (create or edit)
* @param int $participantIndex The index of the participant being evaluated (unused)
* @param array<string, mixed> $formData Current form data (unused)
*
* @return bool True if the booking was made by an internal agency
*/
public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool
{
return $bookingDto->isInternalAgencyBooking();
}
/**
* The agency code is a property of the booking, not of any form field.
*
* @return string[] Always empty
*/
public function getDependentFields(): array
{
return [];
}
public function getDescription(): string
{
return 'Checks if the booking is an internal agency booking';
}
}