fix: do not copy applicant address into participant for agency bookings
This commit is contained in:
@@ -138,13 +138,21 @@ class BookingEditDataLoader
|
||||
$this->travelDataService->patchAvailabilities($travelData, $availabilities);
|
||||
$this->travelDataService->patchMutability($travelData, $mutableData);
|
||||
|
||||
$formData = $this->bookingDataProcessor->createBookingDtoFromBooking($bookingData, $travelData);
|
||||
|
||||
// Set agency code for internal agency detection (used by field state conditions)
|
||||
$formData->agencyCode = null !== $bookingData->agencyId
|
||||
// Resolve agency code before building the DTO so the internal-agency flag can be
|
||||
// passed to createBookingDtoFromBooking, preventing applicant data from being
|
||||
// copied into participant[0] for agency bookings where they are different people.
|
||||
$agencyCode = null !== $bookingData->agencyId
|
||||
? $this->agencyLoader->loadById($bookingData->agencyId)?->code
|
||||
: null;
|
||||
|
||||
$formData = $this->bookingDataProcessor->createBookingDtoFromBooking(
|
||||
$bookingData,
|
||||
$travelData,
|
||||
AgencyLoader::INTERNAL_AGENCY_CODE === $agencyCode,
|
||||
);
|
||||
|
||||
$formData->agencyCode = $agencyCode;
|
||||
|
||||
// Set original fingerprint BEFORE applying draft, so dirty detection
|
||||
// compares against the original API data (not the draft-modified data)
|
||||
$formData->originalFingerprint = $this->fingerprintService->generateFingerprint($formData, true);
|
||||
|
||||
Reference in New Issue
Block a user