feat: update personal data of canceled participants as well

addresses #869bze0kq
This commit is contained in:
Björn Fromme
2026-02-05 11:23:25 +01:00
parent 3036a7773c
commit 2f9930a240
2 changed files with 4 additions and 11 deletions
@@ -21,7 +21,7 @@ class PersonalDataSynchronizer
/** /**
* Updates participant personal data from form input. * Updates participant personal data from form input.
* *
* Processes all active participants (status 'F' or 'A'). Skips canceled participants (status 'S'). * Processes all participants regardless of status, including canceled participants (status 'S').
* Updates all personal data fields and communication information. * Updates all personal data fields and communication information.
* *
* Also fills missing mandatory fields on the applicant object for company bookings * Also fills missing mandatory fields on the applicant object for company bookings
@@ -41,13 +41,6 @@ class PersonalDataSynchronizer
$this->fillMissingApplicantFields($bookingData); $this->fillMissingApplicantFields($bookingData);
foreach ($participants as $participant) { foreach ($participants as $participant) {
// For canceled participants, only ensure mandatory fields have defaults
// Skip other field updates as their data cannot be edited
if ('S' === $participant->status) {
$this->fillMissingParticipantFields($bookingData->participants[$participant->index]);
continue;
}
$bookingData->participants[$participant->index]->firstName = $participant->firstName; $bookingData->participants[$participant->index]->firstName = $participant->firstName;
$bookingData->participants[$participant->index]->name = $participant->lastName; $bookingData->participants[$participant->index]->name = $participant->lastName;
$bookingData->participants[$participant->index]->dateOfBirth = $participant->dateOfBirth; $bookingData->participants[$participant->index]->dateOfBirth = $participant->dateOfBirth;
@@ -164,15 +164,15 @@ class BookingDataProcessorTest extends TestCase
$this->assertEquals('+49123456789', $participant->communication->mobile); $this->assertEquals('+49123456789', $participant->communication->mobile);
} }
public function testInactiveParticipantsPersonalDataNotUpdated(): void public function testCanceledParticipantsPersonalDataIsUpdated(): void
{ {
$formData = $this->createFormDataWithInactiveParticipant(); $formData = $this->createFormDataWithInactiveParticipant();
$this->processor->createUpdateRequestPayload($formData); $this->processor->createUpdateRequestPayload($formData);
$participant = $formData->booking->participants[0]; $participant = $formData->booking->participants[0];
$this->assertEquals('Original', $participant->firstName); $this->assertEquals('Updated', $participant->firstName);
$this->assertEquals('Name', $participant->name); $this->assertEquals('Participant', $participant->name);
} }
public function testApplicantDataSyncWithFirstParticipant(): void public function testApplicantDataSyncWithFirstParticipant(): void