113 lines
3.5 KiB
PHP
113 lines
3.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\BusProNet\Model;
|
|
|
|
use Symfony\Component\Serializer\Attribute\Context;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
|
|
|
|
/**
|
|
* Represents a service offering with pricing, availability, and configuration options.
|
|
*
|
|
* This class handles various types of services including transportation, additional
|
|
* services, courses, and rentals. It provides constants for service categorization
|
|
* and status management, along with serialization groups for API responses.
|
|
*/
|
|
class Service
|
|
{
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $id = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $category = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $status = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public bool $mandatory = false;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public bool $autoBook = false;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $label = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
#[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
|
|
public ?\DateTimeImmutable $dateFrom = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $timeFrom = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $dayTime = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
#[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
|
|
public ?\DateTimeImmutable $dateTo = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $subType = null;
|
|
|
|
#[Groups(['booking'])]
|
|
public ?int $totalCount = null;
|
|
|
|
#[Groups(['api:single', 'snapshot'])]
|
|
public array $mapping = [];
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?float $price = null;
|
|
|
|
#[Groups(['api:single', 'snapshot'])]
|
|
public ?float $totalPrice = null;
|
|
|
|
#[Groups(['api:single', 'snapshot'])]
|
|
public array $individualPrice = [];
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $available = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $source = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $direction = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $ageFrom = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $ageTo = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $birthYearFrom = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?int $birthYearTo = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $ageConstraintType = null;
|
|
|
|
#[Groups(['api:single'])]
|
|
public ?array $ageConstraintMetadata = null;
|
|
|
|
#[Groups(['api:single'])]
|
|
public ?string $rawAgeConstraintData = null;
|
|
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public ?string $description = null;
|
|
|
|
/**
|
|
* Indicates whether this service should be included in insurance eligibility price calculation.
|
|
*
|
|
* Maps to XML attribute 'versicherungsberechnung' (J=true, N=false).
|
|
* When false, this service's price is excluded when determining which insurance
|
|
* tier is appropriate for a participant.
|
|
*/
|
|
#[Groups(['api:single', 'api:list', 'snapshot'])]
|
|
public bool $includeInInsuranceCalculation = true;
|
|
}
|