35 lines
990 B
PHP
35 lines
990 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\BusProNet\Model;
|
|
|
|
/**
|
|
* Response model for service availability API calls.
|
|
*
|
|
* Contains both service-level availability data and travel-level
|
|
* booking status information from the VERFUEGBARKEIT endpoint.
|
|
*/
|
|
class ServiceAvailabilityResponse
|
|
{
|
|
/**
|
|
* @param array<int, Availability> $services Service availability data indexed by service ID
|
|
* @param array<string> $allowedBookingStatus Allowed booking status codes (e.g., ['F', 'O', 'A'])
|
|
* @param string|null $travelStatus Travel status from API (e.g., 'frei', 'anfrage')
|
|
*/
|
|
public function __construct(
|
|
private readonly array $services,
|
|
public readonly array $allowedBookingStatus = [],
|
|
public readonly ?string $travelStatus = null,
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* @return array<int, Availability>
|
|
*/
|
|
public function getServices(): array
|
|
{
|
|
return $this->services;
|
|
}
|
|
}
|