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);
|
||||
|
||||
@@ -34,7 +34,7 @@ class BookingEditSubmitGuard
|
||||
*/
|
||||
public function reconcileImmutableCategories(BookingDto $workingDto, Booking $freshBooking): bool
|
||||
{
|
||||
$baselineDto = $this->bookingDataProcessor->createBookingDtoFromBooking($freshBooking, $workingDto->travel);
|
||||
$baselineDto = $this->bookingDataProcessor->createBookingDtoFromBooking($freshBooking, $workingDto->travel, $workingDto->isInternalAgencyBooking());
|
||||
// Booking-level D-4 cutoff used as submit-time safety net for rentals.
|
||||
$serviceCutoffReachedCondition = new TravelStartCutoffReachedCondition(
|
||||
TravelStartCutoffReachedCondition::DEFAULT_DAYS_BEFORE_START
|
||||
|
||||
Reference in New Issue
Block a user