feat: load cms data early to display image on login page
This commit is contained in:
@@ -128,21 +128,15 @@ class BookingSummaryDataService
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches CMS data for the product and hotel in the booking.
|
||||
* Fetches CMS data for a product and hotel combination.
|
||||
*
|
||||
* Data is cached for 1 hour as it rarely changes. Returns null
|
||||
* if the API call fails or if product/hotel codes are not available.
|
||||
* if the API call fails or if product code is not available.
|
||||
* This method can be called early in the booking flow to warm the cache.
|
||||
*/
|
||||
private function getCmsData(BookingDto $bookingDto): ?array
|
||||
public function getCmsDataForProduct(?string $productCode, ?string $hotelCode): ?array
|
||||
{
|
||||
$productCode = $bookingDto->travel->productCode;
|
||||
$hotelCode = $bookingDto->travel->hotel?->code;
|
||||
|
||||
if (null === $productCode) {
|
||||
$this->logger->debug('Cannot fetch CMS data: product code is not available', [
|
||||
'travel_id' => $bookingDto->travel->id,
|
||||
]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -177,4 +171,23 @@ class BookingSummaryDataService
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 === $productCode) {
|
||||
$this->logger->debug('Cannot fetch CMS data: product code is not available', [
|
||||
'travel_id' => $bookingDto->travel->id,
|
||||
]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->getCmsDataForProduct($productCode, $hotelCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user