chore: merge service methods
This commit is contained in:
@@ -60,7 +60,18 @@ class BookingSummaryDataService
|
||||
$pricingData = $this->priceCalculator->getPricingBreakdown($bookingDto, $roomPricingMode);
|
||||
|
||||
// Fetch CMS data (images, etc.)
|
||||
$cmsData = $this->getCmsData($bookingDto);
|
||||
$productCode = $bookingDto->travel->productCode;
|
||||
$hotelCode = $bookingDto->travel->hotel?->code;
|
||||
|
||||
if (null === $hotelCode) {
|
||||
$this->logger->debug('Cannot fetch hotel data: hotel code is not available', [
|
||||
'travel_id' => $bookingDto->travel->id,
|
||||
]);
|
||||
|
||||
$cmsData = null;
|
||||
} else {
|
||||
$cmsData = $this->getCmsDataForProduct($productCode, $hotelCode);
|
||||
}
|
||||
|
||||
// Calculate participant count from room capacity (source of truth)
|
||||
$participantCount = $this->calculateParticipantCountFromRooms($bookingDto);
|
||||
@@ -195,22 +206,4 @@ class BookingSummaryDataService
|
||||
return [] === $parts ? null : implode("\n", $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches CMS data for the product and hotel in the booking.
|
||||
*/
|
||||
private function getCmsData(BookingDto $bookingDto): ?array
|
||||
{
|
||||
$productCode = $bookingDto->travel->productCode;
|
||||
$hotelCode = $bookingDto->travel->hotel?->code;
|
||||
|
||||
if (null === $hotelCode) {
|
||||
$this->logger->debug('Cannot fetch hotel data: hotel code is not available', [
|
||||
'travel_id' => $bookingDto->travel->id,
|
||||
]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->getCmsDataForProduct($productCode, $hotelCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user