<?php
declare(strict_types=1);
namespace Slivki\BusinessFeature\Yclients\Dto;
use OpenApi\Annotations as OA;
use Nelmio\ApiDocBundle\Annotation\Model;
use JsonSerializable;
final class StaffDto implements JsonSerializable
{
/**
* @OA\Property(
* property="id",
* type="integer",
* description="ID сотрудника",
* example=12345
* )
*/
private int $id;
/**
* @OA\Property(
* property="name",
* type="string",
* description="Имя сотрудника",
* example="Иван Иванов"
* )
*/
private string $name;
/**
* @OA\Property(
* property="rating",
* type="number",
* format="float",
* description="Рейтинг сотрудника",
* example=4.5
* )
*/
private float $rating;
/**
* @OA\Property(
* property="avatar",
* type="string",
* description="URL аватара сотрудника",
* example="https://example.com/avatar.jpg"
* )
*/
private string $avatar;
/**
* @OA\Property(
* property="specialization",
* type="string",
* description="Специализация сотрудника",
* example="Парикмахер"
* )
*/
private string $specialization;
/**
* @OA\Property(
* property="external_link",
* type="string",
* description="Внешняя ссылка на профиль сотрудника",
* example="https://example.com/staff/12345"
* )
*/
private ?string $externalLink;
/**
* @OA\Property(
* property="images",
* type="object",
* ref=@Model(type=ImagesDto::class),
* description="Изображения сотрудника"
* )
*/
private ?ImagesDto $images;
public function __construct(
int $id,
string $name,
float $rating,
string $avatar,
string $specialization,
?string $externalLink,
?ImagesDto $images
) {
$this->id = $id;
$this->name = $name;
$this->rating = $rating;
$this->avatar = $avatar;
$this->specialization = $specialization;
$this->externalLink = $externalLink;
$this->images = $images;
}
public function jsonSerialize(): array
{
return [
'id' => $this->id,
'name' => $this->name,
'rating' => $this->rating,
'avatar' => $this->avatar,
'specialization' => $this->specialization,
'external_link' => $this->externalLink,
'images' => $this->images,
];
}
}