feat: load cms data early to display image on login page

This commit is contained in:
Björn Fromme
2026-03-16 12:00:55 +01:00
parent ce88e1f97b
commit 15fdfdc42e
4 changed files with 56 additions and 14 deletions
+23 -10
View File
@@ -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);
}
}