src/Response/Beauty/Offer/MasterResponse.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\Response\Beauty\Offer;
  4. use Nelmio\ApiDocBundle\Annotation\Model;
  5. use OpenApi\Annotations as OA;
  6. use JsonSerializable;
  7. use Slivki\Response\OnlineOrder\Director\DirectorResponse;
  8. final class MasterResponse implements JsonSerializable
  9. {
  10.     /**
  11.      * @OA\Property(
  12.      *     description="Идентификатор мастера",
  13.      *     example=6,
  14.      * )
  15.      */
  16.     private int $id;
  17.     /**
  18.      * @OA\Property(
  19.      *     property="status",
  20.      *     description="Статус мастера",
  21.      *     example="Салон",
  22.      * )
  23.      */
  24.     private string $status;
  25.     /**
  26.      * @OA\Property(
  27.      *     property="firstName",
  28.      *     description="Имя мастера",
  29.      *     example="Имя",
  30.      * )
  31.      */
  32.     private string $firstName;
  33.     /**
  34.      * @OA\Property(
  35.      *     property="lastName",
  36.      *     description="Фамилия мастера",
  37.      *     example="Фамилия",
  38.      * )
  39.      */
  40.     private string $lastName;
  41.     /**
  42.      * @OA\Property(
  43.      *     property="imageUrl",
  44.      *     description="Картинка мастера",
  45.      *     example="https://www.slivki.by/example.png",
  46.      * )
  47.      */
  48.     private string $imageUrl;
  49.     /**
  50.      * @OA\Property(
  51.      *     property="rating",
  52.      *     description="Рейтинг мастера",
  53.      *     example=4.9,
  54.      * )
  55.      */
  56.     private float $rating;
  57.     /**
  58.      * @OA\Property(
  59.      *     property="description",
  60.      *     description="Описание мастера",
  61.      *     example="Пример описания мастера",
  62.      * )
  63.      */
  64.     private ?string $description;
  65.     /**
  66.      * @OA\Property(
  67.      *     property="telegram",
  68.      *     description="Telegram мастера",
  69.      *     example="example",
  70.      *     nullable=true,
  71.      * )
  72.      */
  73.     private ?string $telegram;
  74.     /**
  75.      * @OA\Property(
  76.      *     property="viber",
  77.      *     description="Viber мастера",
  78.      *     example="+375290000000",
  79.      *     nullable=true,
  80.      * )
  81.      */
  82.     private ?string $viber;
  83.     /**
  84.      * @OA\Property(
  85.      *     property="salon",
  86.      *     description="Название салона",
  87.      *     example="Рога и копыта",
  88.      *     nullable=true,
  89.      * )
  90.      */
  91.     private ?string $salon;
  92.     /**
  93.      * @OA\Property(
  94.      *     property="locations",
  95.      *     type="array",
  96.      *     @OA\Items(ref=@Model(type=MasterLocationResponse::class)),
  97.      * ),
  98.      *
  99.      * @var array<MasterLocationResponse>
  100.      */
  101.     private array $locations;
  102.     /**
  103.      * @OA\Property(
  104.      *     property="tags",
  105.      *     type="array",
  106.      *     @OA\Items(type="string", description="Массаж"),
  107.      * ),
  108.      *
  109.      * @var array<string>
  110.      */
  111.     private array $tags;
  112.     /**
  113.      * @OA\Property(
  114.      *     property="offerIds",
  115.      *     type="array",
  116.      *     @OA\Items(type="integer", description="Акции"),
  117.      * ),
  118.      *
  119.      * @var array<string>
  120.      */
  121.     private array $offerIds;
  122.     /**
  123.      * @OA\Property(
  124.      *     property="director",
  125.      *     type="object",
  126.      *     description="Информауия о директоре",
  127.      *     ref=@Model(type=DirectorResponse::class)
  128.      * )
  129.      */
  130.     private ?DirectorResponse $director;
  131.     /**
  132.      * @OA\Property(
  133.      *     property="categoryIds",
  134.      *     type="array",
  135.      *     @OA\Items(type="integer", description="Категории"),
  136.      * ),
  137.      *
  138.      * @var array<string>
  139.      */
  140.     private array $categoryIds;
  141.     /**
  142.      * @OA\Property(
  143.      *     property="onlineOrderUrl",
  144.      *     description="Ccылка на запись",
  145.      *     example="+https://wwww.slivki.by",
  146.      *     nullable=true,
  147.      * )
  148.      */
  149.     private ?string $onlineOrderUrl;
  150.     /**
  151.      * @OA\Property(
  152.      *     property="level",
  153.      *     description="Уровень мастера",
  154.      *     example="1",
  155.      *     nullable=true,
  156.      * )
  157.      */
  158.     private ?int $level;
  159.     public function __construct(
  160.         int $id,
  161.         string $status,
  162.         string $firstName,
  163.         string $lastName,
  164.         string $imageUrl,
  165.         float $rating,
  166.         ?string $description,
  167.         ?string $telegram,
  168.         ?string $viber,
  169.         ?string $salon,
  170.         array $locations,
  171.         array $tags,
  172.         array $offerIds,
  173.         ?DirectorResponse $director,
  174.         array $categoryIds,
  175.         ?string $onlineOrderUrl,
  176.         ?int $level
  177.     ) {
  178.         $this->id $id;
  179.         $this->status $status;
  180.         $this->firstName $firstName;
  181.         $this->lastName $lastName;
  182.         $this->imageUrl $imageUrl;
  183.         $this->rating $rating;
  184.         $this->description $description;
  185.         $this->telegram $telegram;
  186.         $this->viber $viber;
  187.         $this->salon $salon;
  188.         $this->locations $locations;
  189.         $this->tags $tags;
  190.         $this->offerIds $offerIds;
  191.         $this->director $director;
  192.         $this->categoryIds $categoryIds;
  193.         $this->onlineOrderUrl $onlineOrderUrl;
  194.         $this->level $level;
  195.     }
  196.     public function getId(): int
  197.     {
  198.         return $this->id;
  199.     }
  200.     public function getFirstName(): string
  201.     {
  202.         return $this->firstName;
  203.     }
  204.     public function getLastName(): string
  205.     {
  206.         return $this->lastName;
  207.     }
  208.     public function getStatus(): string
  209.     {
  210.         return $this->status;
  211.     }
  212.     public function getImageUrl(): string
  213.     {
  214.         return $this->imageUrl;
  215.     }
  216.     public function getRating(): float
  217.     {
  218.         return $this->rating;
  219.     }
  220.     public function getDescription(): ?string
  221.     {
  222.         return $this->description;
  223.     }
  224.     public function getTelegram(): ?string
  225.     {
  226.         return $this->telegram;
  227.     }
  228.     public function getViber(): ?string
  229.     {
  230.         return $this->viber;
  231.     }
  232.     public function getSalon(): ?string
  233.     {
  234.         return $this->salon;
  235.     }
  236.     public function getLocations(): array
  237.     {
  238.         return $this->locations;
  239.     }
  240.     public function getTags(): array
  241.     {
  242.         return $this->tags;
  243.     }
  244.     public function getOfferIds(): array
  245.     {
  246.         return $this->offerIds;
  247.     }
  248.     public function getDirector(): ?DirectorResponse
  249.     {
  250.         return $this->director;
  251.     }
  252.     public function getCategoryIds(): array
  253.     {
  254.         return $this->categoryIds;
  255.     }
  256.     public function getOnlineOrderUrl(): ?string
  257.     {
  258.         return $this->onlineOrderUrl;
  259.     }
  260.     public function getLevel(): ?int
  261.     {
  262.         return $this->level;
  263.     }
  264.     public function jsonSerialize(): array
  265.     {
  266.         return [
  267.             'id' => $this->id,
  268.             'status' => $this->status,
  269.             'firstName' => $this->firstName,
  270.             'lastName' => $this->lastName,
  271.             'imageUrl' => $this->imageUrl,
  272.             'rating' => $this->rating,
  273.             'description' => $this->description,
  274.             'telegram' => $this->telegram,
  275.             'viber' => $this->viber,
  276.             'salon' => $this->salon,
  277.             'locations' => $this->locations,
  278.             'tags' => $this->tags,
  279.             'offerIds' => $this->offerIds,
  280.             'director' => $this->director,
  281.             'categoryIds' => $this->categoryIds,
  282.             'onlineOrderUrl' => $this->onlineOrderUrl,
  283.             'level' => $this->level,
  284.         ];
  285.     }
  286. }