fix: properly handle parking service selection
This commit is contained in:
@@ -124,9 +124,15 @@ class BookingDataProcessor
|
|||||||
// Pickup location
|
// Pickup location
|
||||||
$participantData->pickup = $booking->getPickupForParticipant($index);
|
$participantData->pickup = $booking->getPickupForParticipant($index);
|
||||||
|
|
||||||
// Parking (stored in form data, not in booking entity - needs special handling)
|
// Parking service (for self-organized PKW transportation)
|
||||||
// For now, leave as false - may need to extract from transportation services
|
$parkingServices = $booking->getAdditionalServicesForParticipantByGroup($index, Constants::TOKEN_PARKING);
|
||||||
|
if (false === empty($parkingServices)) {
|
||||||
|
$participantData->parking = true;
|
||||||
|
$participantData->parkingService = reset($parkingServices);
|
||||||
|
} else {
|
||||||
$participantData->parking = false;
|
$participantData->parking = false;
|
||||||
|
$participantData->parkingService = null;
|
||||||
|
}
|
||||||
|
|
||||||
// License plate (not stored in booking entity)
|
// License plate (not stored in booking entity)
|
||||||
$participantData->licensePlate = null;
|
$participantData->licensePlate = null;
|
||||||
@@ -213,6 +219,11 @@ class BookingDataProcessor
|
|||||||
$participant->rentalInsurance = $travel->additionalServices[$participant->rentalInsurance->id];
|
$participant->rentalInsurance = $travel->additionalServices[$participant->rentalInsurance->id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enrich parking service
|
||||||
|
if (null !== $participant->parkingService && isset($travel->additionalServices[$participant->parkingService->id])) {
|
||||||
|
$participant->parkingService = $travel->additionalServices[$participant->parkingService->id];
|
||||||
|
}
|
||||||
|
|
||||||
// Enrich transportation services
|
// Enrich transportation services
|
||||||
if (null !== $participant->transportationOutbound && isset($travel->transportationServices[$participant->transportationOutbound->id])) {
|
if (null !== $participant->transportationOutbound && isset($travel->transportationServices[$participant->transportationOutbound->id])) {
|
||||||
$participant->transportationOutbound = $travel->transportationServices[$participant->transportationOutbound->id];
|
$participant->transportationOutbound = $travel->transportationServices[$participant->transportationOutbound->id];
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class ParticipantServiceProcessor
|
|||||||
* Collects additional services from a participant for mapping.
|
* Collects additional services from a participant for mapping.
|
||||||
*
|
*
|
||||||
* Extracts all additional services (courses, board, rentals, ski pass, rental insurance,
|
* Extracts all additional services (courses, board, rentals, ski pass, rental insurance,
|
||||||
* additional services) from a participant into a flat array of Service objects.
|
* parking, additional services) from a participant into a flat array of Service objects.
|
||||||
*
|
*
|
||||||
* @param ParticipantDto $participant The participant data
|
* @param ParticipantDto $participant The participant data
|
||||||
*
|
*
|
||||||
@@ -140,6 +140,11 @@ class ParticipantServiceProcessor
|
|||||||
$services[] = $participant->rentalInsurance;
|
$services[] = $participant->rentalInsurance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add parking service if selected (for self-organized PKW transportation)
|
||||||
|
if (true === $participant->parking && null !== $participant->parkingService) {
|
||||||
|
$services[] = $participant->parkingService;
|
||||||
|
}
|
||||||
|
|
||||||
return $services;
|
return $services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user