<?php
declare(strict_types=1);
namespace Slivki\BusinessFeature\Yclients\Dto;
use OpenApi\Annotations as OA;
use Nelmio\ApiDocBundle\Annotation\Model;
use JsonSerializable;
final class AppointmentDto implements JsonSerializable
{
/**
* @OA\Property(
* property="service",
* type="object",
* ref=@Model(type=ServiceDto::class),
* description="Услуга",
* ),
*
* @var ServiceDto
*/
private ServiceDto $service;
/**
* @OA\Property(
* property="times",
* type="array",
* @OA\Items(
* type="string",
* example="10:00",
* description="Время",
* ),
* description="Время",
* ),
*
* @var array
*/
private array $times;
/**
* @OA\Property(
* property="location",
* type="object",
* ref=@Model(type=LocationDto::class),
* description="Локация",
* ),
*
* @var LocationDto
*/
private LocationDto $location;
/**
* @OA\Property(
* property="externalTimes",
* description="Время с ссылкой на внешний ресурс",
* type="array",
* @OA\Items(ref=@Model(type=TimeDto::class)),
* )
*
* @var array<TimeDto>
*/
private array $externalTimes;
public function __construct(
ServiceDto $service,
array $times,
LocationDto $location,
array $externalTimes = []
) {
$this->service = $service;
$this->times = $times;
$this->location = $location;
$this->externalTimes = $externalTimes;
}
public function jsonSerialize(): array
{
return [
'service' => $this->service,
'times' => $this->times,
'location' => $this->location,
'externalTimes' => $this->externalTimes,
];
}
}