<?php
declare(strict_types=1);
namespace Slivki\Response\User\Favorite;
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA;
use JsonSerializable;
use Slivki\Response\Offer\Location\OfferLocationResponse;
final class GetUserFavoriteOffersResponse implements JsonSerializable
{
/**
* @OA\Property(
* property="ID",
* type="integer",
* description="ID",
* ),
*
* @var int
*/
private int $id;
/**
* @OA\Property(
* property="name",
* type="string",
* description="Название",
* ),
*
* @var string
*/
private string $name;
/**
* @OA\Property(
* property="regularPrice",
* type="string",
* description="Обычная цена",
* ),
*
* @var string
*/
private string $regularPrice;
/**
* @OA\Property(
* property="offerPrice",
* type="string",
* description="Цена по акции",
* ),
*
* @var string
*/
private string $offerPrice;
/**
* @OA\Property(
* property="discountPercent",
* type="string",
* description="Процент скидки",
* ),
*
* @var string
*/
private string $discountPercent;
/**
* @OA\Property(
* property="saleCount",
* type="integer",
* description="Количество продаж",
* ),
*
* @var int
*/
private int $saleCount;
/**
* @OA\Property(
* property="imageURL",
* type="string",
* description="URL изображения",
* ),
*
* @var string
*/
private string $imageUrl;
/**
* @OA\Property(
* property="verticalImageUrl",
* type="string",
* description="Вертикальное изображение",
* ),
*
* @var string
*/
private string $verticalImageUrl;
/**
* @OA\Property(
* property="activeTill",
* type="string",
* description="Активно до",
* ),
*
* @var string
*/
private string $activeTill;
/**
* @OA\Property(
* property="rating",
* type="number",
* description="Рейтинг",
* ),
*
* @var float
*/
private float $rating;
/**
* @OA\Property(
* property="companyLogoImage",
* type="string",
* description="Логотип компании",
* ),
*
* @var string
*/
private string $companyLogoImage;
/**
* @OA\Property(
* property="companyName",
* type="string",
* description="Название компании",
* ),
*
* @var string
*/
private string $companyName;
/**
* @OA\Property(
* property="offerType",
* type="integer",
* description="Тип акции",
* ),
*
* @var int
*/
private int $offerType;
/**
* @OA\Property(
* property="address",
* type="string",
* description="Адрес",
* ),
*
* @var string
*/
private string $address;
/**
* @OA\Property(
* property="visitCount",
* type="integer",
* description="Количество посещений",
* ),
*
* @var int
*/
private int $visitCount;
/**
* @OA\Property(
* property="numberOfPromocodesPerDay",
* type="integer",
* description="Количество промокодов в день",
* ),
*
* @var int
*/
private int $numberOfPromocodesPerDay;
/**
* @OA\Property(
* property="conversion",
* type="number",
* description="Конверсия",
* ),
*
* @var float
*/
private float $conversion;
/**
* @OA\Property(
* property="shopImages",
* type="array",
* @OA\Items(type="string"),
* description="Изображения магазина",
* ),
*
* @var array<string>
*/
private array $shopImages;
/**
* @OA\Property(
* property="images",
* type="array",
* @OA\Items(type="string"),
* description="Изображения",
* ),
*
* @var array<string>
*/
private array $images;
/**
* @OA\Property(
* property="locations",
* type="array",
* @OA\Items(ref=@Model(type=OfferLocationResponse::class)),
* description="Локации",
* ),
*
* @var array<OfferLocationResponse>
*/
private array $locations;
/**
* @OA\Property(
* property="allowedOnlineOrderTypes",
* type="array",
* @OA\Items(type="string"),
* description="Типы онлайн заказов",
* ),
*
* @var array<string>|null
*/
private ?array $allowedOnlineOrderTypes;
/**
* @OA\Property(
* property="partnerOnlineRegistrationLink",
* type="string",
* description="Ссылка на регистрацию партнера онлайн",
* ),
*
* @var string|null
*/
private ?string $partnerOnlineRegistrationLink;
/**
* @OA\Property(
* property="paymentMethodsForOnlineOrder",
* nullable=true,
* type="array",
* @OA\Items(type="string"),
* description="Методы оплаты для онлайн заказа",
* ),
*
* @var array<string>
*/
private array $paymentMethodsForOnlineOrder;
public function __construct(
int $id,
string $name,
string $regularPrice,
string $offerPrice,
string $discountPercent,
int $saleCount,
string $imageUrl,
string $verticalImageUrl,
string $activeTill,
float $rating,
string $companyLogoImage,
string $companyName,
int $offerType,
string $address,
int $visitCount,
int $numberOfPromocodesPerDay,
float $conversion,
array $shopImages,
array $images,
array $locations,
?array $allowedOnlineOrderTypes,
?string $partnerOnlineRegistrationLink,
array $paymentMethodsForOnlineOrder
) {
$this->id = $id;
$this->name = $name;
$this->regularPrice = $regularPrice;
$this->offerPrice = $offerPrice;
$this->discountPercent = $discountPercent;
$this->saleCount = $saleCount;
$this->imageUrl = $imageUrl;
$this->verticalImageUrl = $verticalImageUrl;
$this->activeTill = $activeTill;
$this->rating = $rating;
$this->companyLogoImage = $companyLogoImage;
$this->companyName = $companyName;
$this->offerType = $offerType;
$this->address = $address;
$this->visitCount = $visitCount;
$this->numberOfPromocodesPerDay = $numberOfPromocodesPerDay;
$this->conversion = $conversion;
$this->shopImages = $shopImages;
$this->images = $images;
$this->locations = $locations;
$this->allowedOnlineOrderTypes = $allowedOnlineOrderTypes;
$this->partnerOnlineRegistrationLink = $partnerOnlineRegistrationLink;
$this->paymentMethodsForOnlineOrder = $paymentMethodsForOnlineOrder;
}
public function getRating(): float
{
return $this->rating;
}
public function getSaleCount(): int
{
return $this->saleCount;
}
public function getLocations(): array
{
return $this->locations;
}
public function jsonSerialize(): array
{
return [
'ID' => $this->id,
'name' => $this->name,
'regularPrice' => $this->regularPrice,
'offerPrice' => $this->offerPrice,
'discountPercent' => $this->discountPercent,
'saleCount' => $this->saleCount,
'imageURL' => $this->imageUrl,
'verticalImageUrl' => $this->verticalImageUrl,
'activeTill' => $this->activeTill,
'rating' => $this->rating,
'companyLogoImage' => $this->companyLogoImage,
'companyName' => $this->companyName,
'offerType' => $this->offerType,
'address' => $this->address,
'visitCount' => $this->visitCount,
'numberOfPromocodesPerDay' => $this->numberOfPromocodesPerDay,
'conversion' => $this->conversion,
'shopImages' => $this->shopImages,
'images' => $this->images,
'locations' => $this->locations,
'allowedOnlineOrderTypes' => $this->allowedOnlineOrderTypes,
'partnerOnlineRegistrationLink' => $this->partnerOnlineRegistrationLink,
'paymentMethodsForOnlineOrder' => $this->paymentMethodsForOnlineOrder !== [] ? $this->paymentMethodsForOnlineOrder : null,
];
}
}