chore: merge service methods

This commit is contained in:
Björn Fromme
2026-04-12 17:55:29 +02:00
parent fcfd366dec
commit 6ab34fa87c
+12 -19
View File
@@ -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);
}
}