feat: make email optional for under-16 participants except applicant

This commit is contained in:
fromme committed 2026-10-16 17:49:04 +02:00
1 parent 55a9189284
commit 1ec9c972cd
18 files changed
+435 -336

No files matched your search

@@ -13,7 +13,7 @@ use App\Form\Model\ParticipantDto;
use PHPUnit\Framework\TestCase;
/**
* Covers who the <anmelder> block is built from, and the participant email fallback.
* Covers who the <anmelder> block is built from, and that a participant's blank email stays blank.
*/
class BookingPayloadBuilderTest extends TestCase
{
@@ -69,7 +69,7 @@ class BookingPayloadBuilderTest extends TestCase
$this->assertArrayNotHasKey('idadresse', $payload['anmelder']);
}
public function testParticipantWithoutEmailInheritsTheApplicants(): void
public function testParticipantWithoutEmailIsSentWithoutOne(): void
{
$bookingDto = $this->createBookingDto();
$bookingDto->applicantTravels = false;
@@ -78,10 +78,10 @@ class BookingPayloadBuilderTest extends TestCase
$payload = $this->builder->buildCreatePayload($bookingDto, 'BUCHUNG');
$this->assertSame(
'e[email protected]',
$payload['teilnehmerliste']['teilnehmer'][0]['kommunikation']['email'],
'BusPro rejects a participant without a Mail-Adresse with 650, but accepts a shared one'
$this->assertArrayNotHasKey(
'email',
$payload['teilnehmerliste']['teilnehmer'][0]['kommunikation'],
'BusPro accepts a participant without a Mail-Adresse; the applicant\'s must not be borrowed'
);
}