feat: update personal data of canceled participants as well

addresses #869bze0kq
This commit is contained in:
Björn Fromme
2026-03-16 12:02:59 +01:00
parent c2054a1ef6
commit bbc011ddb9
2 changed files with 4 additions and 11 deletions
@@ -21,7 +21,7 @@ class PersonalDataSynchronizer
/**
* 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.
*
* Also fills missing mandatory fields on the applicant object for company bookings
@@ -41,13 +41,6 @@ class PersonalDataSynchronizer
$this->fillMissingApplicantFields($bookingData);
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]->name = $participant->lastName;
$bookingData->participants[$participant->index]->dateOfBirth = $participant->dateOfBirth;
@@ -164,15 +164,15 @@ class BookingDataProcessorTest extends TestCase
$this->assertEquals('+49123456789', $participant->communication->mobile);
}
public function testInactiveParticipantsPersonalDataNotUpdated(): void
public function testCanceledParticipantsPersonalDataIsUpdated(): void
{
$formData = $this->createFormDataWithInactiveParticipant();
$this->processor->createUpdateRequestPayload($formData);
$participant = $formData->booking->participants[0];
$this->assertEquals('Original', $participant->firstName);
$this->assertEquals('Name', $participant->name);
$this->assertEquals('Updated', $participant->firstName);
$this->assertEquals('Participant', $participant->name);
}
public function testApplicantDataSyncWithFirstParticipant(): void