src/Response/OnlineOrder/Director/DirectorResponse.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\Response\OnlineOrder\Director;
  4. use JsonSerializable;
  5. use OpenApi\Annotations as OA;
  6. final class DirectorResponse implements JsonSerializable
  7. {
  8.     /**
  9.      * @OA\Property(
  10.      *     description="Идентификатор директора",
  11.      *     type="integer",
  12.      *     example=1,
  13.      * )
  14.      */
  15.     private int $id;
  16.     /**
  17.      * @OA\Property(
  18.      *     description="Лого директора",
  19.      *     type="string",
  20.      *     nullable=true,
  21.      *     example="https://example.com/logo.png",
  22.      * )
  23.      */
  24.     private ?string $logo;
  25.     /**
  26.      * @OA\Property(
  27.      *     description="Имя компании",
  28.      *     type="string",
  29.      *     nullable=true,
  30.      *     example="Тестовая",
  31.      * )
  32.      */
  33.     private ?string $name;
  34.     /**
  35.      * @OA\Property(
  36.      *     description="Legal",
  37.      *     type="string",
  38.      *     nullable=true,
  39.      *     example="ynp",
  40.      * )
  41.      */
  42.     private ?string $legalEntity;
  43.     /**
  44.      * @OA\Property(
  45.      *     description="Tax id",
  46.      *     type="description",
  47.      *     nullable=true,
  48.      *     example="23ff331",
  49.      * )
  50.      */
  51.     private ?string $taxId;
  52.     public function __construct(
  53.         int $id,
  54.         ?string $logo,
  55.         ?string $name,
  56.         ?string $legalEntity,
  57.         ?string $taxId
  58.     ) {
  59.         $this->id $id;
  60.         $this->logo $logo;
  61.         $this->name $name;
  62.         $this->legalEntity $legalEntity;
  63.         $this->taxId $taxId;
  64.     }
  65.     public function jsonSerialize(): array
  66.     {
  67.         return [
  68.             'id' => $this->id,
  69.             'logo' => $this->logo,
  70.             'name' => $this->name,
  71.             'legalEntity' => $this->legalEntity,
  72.             'taxId' => $this->taxId,
  73.         ];
  74.     }
  75. }