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="locations",
  68.      *     type="array",
  69.      *     @OA\Items(ref=@Model(type=MasterLocationResponse::class)),
  70.      * ),
  71.      *
  72.      * @var array<MasterLocationResponse>
  73.      */
  74.     private array $locations;
  75.     /**
  76.      * @OA\Property(
  77.      *     property="tags",
  78.      *     type="array",
  79.      *     @OA\Items(type="string", description="Массаж"),
  80.      * ),
  81.      *
  82.      * @var array<string>
  83.      */
  84.     private array $tags;
  85.     /**
  86.      * @OA\Property(
  87.      *     property="offerIds",
  88.      *     type="array",
  89.      *     @OA\Items(type="integer", description="Акции"),
  90.      * ),
  91.      *
  92.      * @var array<string>
  93.      */
  94.     private array $offerIds;
  95.     /**
  96.      * @OA\Property(
  97.      *     property="director",
  98.      *     type="object",
  99.      *     description="Информауия о директоре",
  100.      *     ref=@Model(type=DirectorResponse::class)
  101.      * )
  102.      */
  103.     private ?DirectorResponse $director;
  104.     public function __construct(
  105.         int $id,
  106.         string $status,
  107.         string $firstName,
  108.         string $lastName,
  109.         string $imageUrl,
  110.         float $rating,
  111.         ?string $description,
  112.         array $locations,
  113.         array $tags,
  114.         array $offerIds,
  115.         ?DirectorResponse $director
  116.     ) {
  117.         $this->id $id;
  118.         $this->status $status;
  119.         $this->firstName $firstName;
  120.         $this->lastName $lastName;
  121.         $this->imageUrl $imageUrl;
  122.         $this->rating $rating;
  123.         $this->description $description;
  124.         $this->locations $locations;
  125.         $this->tags $tags;
  126.         $this->offerIds $offerIds;
  127.         $this->director $director;
  128.     }
  129.     public function getId(): int
  130.     {
  131.         return $this->id;
  132.     }
  133.     public function getFirstName(): string
  134.     {
  135.         return $this->firstName;
  136.     }
  137.     public function getLastName(): string
  138.     {
  139.         return $this->lastName;
  140.     }
  141.     public function getStatus(): string
  142.     {
  143.         return $this->status;
  144.     }
  145.     public function getImageUrl(): string
  146.     {
  147.         return $this->imageUrl;
  148.     }
  149.     public function getRating(): float
  150.     {
  151.         return $this->rating;
  152.     }
  153.     public function getDescription(): ?string
  154.     {
  155.         return $this->description;
  156.     }
  157.     public function getLocations(): array
  158.     {
  159.         return $this->locations;
  160.     }
  161.     public function getTags(): array
  162.     {
  163.         return $this->tags;
  164.     }
  165.     public function getOfferIds(): array
  166.     {
  167.         return $this->offerIds;
  168.     }
  169.     public function getDirector(): ?DirectorResponse
  170.     {
  171.         return $this->director;
  172.     }
  173.     public function jsonSerialize(): array
  174.     {
  175.         return [
  176.             'id' => $this->id,
  177.             'status' => $this->status,
  178.             'firstName' => $this->firstName,
  179.             'lastName' => $this->lastName,
  180.             'imageUrl' => $this->imageUrl,
  181.             'rating' => $this->rating,
  182.             'description' => $this->description,
  183.             'locations' => $this->locations,
  184.             'tags' => $this->tags,
  185.             'offerIds' => $this->offerIds,
  186.             'director' => $this->director,
  187.         ];
  188.     }
  189. }