feat: implement screendesign

This commit is contained in:
Björn Fromme
2026-03-16 11:59:12 +01:00
parent 39e6cc4d68
commit 4a2d1f4a02
84 changed files with 2807 additions and 2603 deletions
+14 -10
View File
@@ -90,8 +90,9 @@ class ParticipantEditDtoTest extends TestCase
$this->createAdultParticipant('[email protected]'),
]);
// Validate second participant (index 1) - applicant (index 0) is exempt from email uniqueness
$wrapper = new ParticipantEditDto(
participant: $bookingDto->participants[0],
participant: $bookingDto->participants[1],
bookingContext: $bookingDto,
);
@@ -187,8 +188,9 @@ class ParticipantEditDtoTest extends TestCase
$this->createAdultParticipant('[email protected]'),
]);
// Validate second participant (index 1) - applicant (index 0) is exempt from email uniqueness
$wrapper = new ParticipantEditDto(
participant: $bookingDto->participants[0],
participant: $bookingDto->participants[1],
bookingContext: $bookingDto,
);
@@ -206,14 +208,15 @@ class ParticipantEditDtoTest extends TestCase
public function testWhitespaceNormalizationInEmailComparison(): void
{
$participant1 = $this->createAdultParticipant('[email protected]');
$participant1->email = ' [email protected] ';
$participant2 = $this->createAdultParticipant('[email protected]');
$participant2->email = ' [email protected] ';
$bookingDto = $this->createBookingDtoWithParticipants([$participant1, $participant2]);
// Validate second participant (index 1) - applicant (index 0) is exempt from email uniqueness
$wrapper = new ParticipantEditDto(
participant: $bookingDto->participants[0],
participant: $bookingDto->participants[1],
bookingContext: $bookingDto,
);
@@ -236,16 +239,16 @@ class ParticipantEditDtoTest extends TestCase
$this->createAdultParticipant('[email protected]'),
]);
// Validate first participant - should fail
// Validate first participant (applicant) - should pass (applicant is exempt from email uniqueness)
$wrapper1 = new ParticipantEditDto(
participant: $bookingDto->participants[0],
bookingContext: $bookingDto,
);
$violations1 = $this->validator->validate($wrapper1, null, ['booking_create']);
$this->assertCount(1, $violations1);
$this->assertCount(0, $violations1);
// Validate second participant - should fail
// Validate second participant - should fail (duplicate with applicant and third participant)
$wrapper2 = new ParticipantEditDto(
participant: $bookingDto->participants[1],
bookingContext: $bookingDto,
@@ -254,7 +257,7 @@ class ParticipantEditDtoTest extends TestCase
$violations2 = $this->validator->validate($wrapper2, null, ['booking_create']);
$this->assertCount(1, $violations2);
// Validate third participant - should fail
// Validate third participant - should fail (duplicate with applicant and second participant)
$wrapper3 = new ParticipantEditDto(
participant: $bookingDto->participants[2],
bookingContext: $bookingDto,
@@ -310,14 +313,15 @@ class ParticipantEditDtoTest extends TestCase
$bookingDto->participants = [$participant1, $participant2];
// Validate second participant (index 1) - applicant (index 0) is exempt from email uniqueness
$wrapper = new ParticipantEditDto(
participant: $bookingDto->participants[0],
participant: $bookingDto->participants[1],
bookingContext: $bookingDto,
);
$violations = $this->validator->validate($wrapper, null, ['booking_edit']);
// Should have uniqueness violation (edit mode with immutable applicant = strict validation)
// Should have uniqueness violation (edit mode still validates email uniqueness for non-applicants)
$this->assertCount(1, $violations);
}