feat: correct determination of inquiry status and conditional voucher field display
This commit is contained in:
@@ -8,6 +8,7 @@ use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Model\BaseData;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\BusProNet\Model\ServiceAvailabilityResponse;
|
||||
use App\BusProNet\Model\Travel;
|
||||
use App\BusProNet\XmlLoader\HotelLoader;
|
||||
use App\BusProNet\XmlLoader\InsuranceLoader;
|
||||
@@ -525,9 +526,9 @@ class TravelDataService
|
||||
* @param bool $cached Whether to use cached data (default: false, TTL when cached: 60 seconds)
|
||||
* @param int $ttl Cache TTL in seconds when $cached is true (default: 60 seconds)
|
||||
*
|
||||
* @return BaseData|null The availability data or null if not available or error occurred
|
||||
* @return ServiceAvailabilityResponse|null The availability data or null if not available or error occurred
|
||||
*/
|
||||
public function getAvailabilityData(int $dateId, bool $cached = false, int $ttl = 60): ?BaseData
|
||||
public function getAvailabilityData(int $dateId, bool $cached = false, int $ttl = 60): ?ServiceAvailabilityResponse
|
||||
{
|
||||
if ($cached) {
|
||||
$cacheKey = sprintf('availability_%d', $dateId);
|
||||
@@ -556,7 +557,7 @@ class TravelDataService
|
||||
/**
|
||||
* Fetches availability data directly from the API without caching.
|
||||
*/
|
||||
private function fetchAvailabilityData(int $dateId): ?BaseData
|
||||
private function fetchAvailabilityData(int $dateId): ?ServiceAvailabilityResponse
|
||||
{
|
||||
try {
|
||||
$availabilities = $this->apiClient->getAvailabilities($dateId);
|
||||
@@ -590,12 +591,13 @@ class TravelDataService
|
||||
* Apply availability data to travel services.
|
||||
*
|
||||
* Updates the availability status of additional and transportation
|
||||
* services based on the provided availability data.
|
||||
* services, and the allowed booking status, based on the provided
|
||||
* availability data.
|
||||
*
|
||||
* @param Travel $travel The travel object to update
|
||||
* @param BaseData $availabilities The availability data for services
|
||||
* @param Travel $travel The travel object to update
|
||||
* @param ServiceAvailabilityResponse $availabilities The availability data for services
|
||||
*/
|
||||
public function patchAvailabilities(Travel $travel, BaseData $availabilities): void
|
||||
public function patchAvailabilities(Travel $travel, ServiceAvailabilityResponse $availabilities): void
|
||||
{
|
||||
$this->travelLoader->patchAvailabilities($travel, $availabilities);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user