Skip to content

Commit

Permalink
Add support for GET /api/v5/store/offers method
Browse files Browse the repository at this point in the history
  • Loading branch information
kifril committed Aug 16, 2024
1 parent 544d161 commit 927b078
Show file tree
Hide file tree
Showing 7 changed files with 536 additions and 0 deletions.
190 changes: 190 additions & 0 deletions src/Model/Entity/Store/OfferProduct.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?php

/**
* PHP version 7.3
*
* @category OfferProduct
* @package RetailCrm\Api\Model\Entity\Store
*/

namespace RetailCrm\Api\Model\Entity\Store;

use DateTime;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;

/**
* Class Product
*
* @category OfferProduct
* @package RetailCrm\Api\Model\Entity\Store
*/
class OfferProduct
{
/**
* @var float
*
* @JMS\Type("float")
* @JMS\SerializedName("minPrice")
*/
public $minPrice;

/**
* @var float
*
* @JMS\Type("float")
* @JMS\SerializedName("maxPrice")
*/
public $maxPrice;

/**
* @var int
*
* @JMS\Type("int")
* @JMS\SerializedName("id")
*/
public $id;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("article")
*/
public $article;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("name")
*/
public $name;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("url")
*/
public $url;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("imageUrl")
*/
public $imageUrl;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("description")
*/
public $description;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("popular")
*/
public $popular;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("stock")
*/
public $stock;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("novelty")
*/
public $novelty;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("recommended")
*/
public $recommended;

/**
* @var array<string, mixed>
*
* @JMS\Type("array")
* @JMS\SerializedName("properties")
*/
public $properties;

/**
* @var \RetailCrm\Api\Model\Entity\FixExternalRow[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Entity\FixExternalRow>")
* @JMS\SerializedName("groups")
*/
public $groups;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("externalId")
*/
public $externalId;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("manufacturer")
*/
public $manufacturer;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("active")
*/
public $active;

/**
* @var float
*
* @JMS\Type("float")
* @JMS\SerializedName("quantity")
*/
public $quantity;

/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("markable")
*/
public $markable;

/**
* @var DateTime
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("updatedAt")
*/
public $updatedAt;

/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("type")
*/
public $type;
}
34 changes: 34 additions & 0 deletions src/Model/Entity/Store/StoreOffer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* PHP version 7.3
*
* @category StoreOffer
* @package RetailCrm\Api\Model\Entity\Store
*/

namespace RetailCrm\Api\Model\Entity\Store;

use RetailCrm\Api\Component\Serializer\Annotation as JMS;

/**
* Class StoreOffer
*
* @category StoreOffer
* @package RetailCrm\Api\Model\Entity\Store
*/
class StoreOffer extends ProductOffer
{
/**
* @JMS\Exclude()
*/
public $price;

/**
* @var \RetailCrm\Api\Model\Entity\Store\Product
*
* @JMS\Type("RetailCrm\Api\Model\Entity\Store\Product")
* @JMS\SerializedName("product")
*/
public $product;
}
86 changes: 86 additions & 0 deletions src/Model/Filter/Store/OfferFilterType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

/**
* PHP version 7.3
*
* @category OfferFilterType
* @package RetailCrm\Api\Model\Filter\Store
*/

namespace RetailCrm\Api\Model\Filter\Store;

use DateTime;
use RetailCrm\Api\Component\FormData\Mapping as Form;

/**
* Class OfferFilterType
*
* @category OfferFilterType
* @package RetailCrm\Api\Model\Filter\Store
*/
class OfferFilterType
{
/**
* @var int[]
*
* @Form\Type("int[]")
* @Form\SerializedName("ids")
*/
public $ids;

/**
* @var string
*
* @Form\Type("string")
* @Form\SerializedName("name")
*/
public $name;

/**
* @var string
*
* @Form\Type("string[]")
* @Form\SerializedName("externalIds")
*/
public $externalIds;

/**
* @var string
*
* @Form\Type("string[]")
* @Form\SerializedName("xmlIds")
*/
public $xmlIds;

/**
* @var string[]
*
* @Form\Type("string[]")
* @Form\SerializedName("properties")
*/
public $properties;

/**
* @var string[]
*
* @Form\Type("string[]")
* @Form\SerializedName("sites")
*/
public $sites;

/**
* @var int
*
* @Form\Type("int")
* @Form\SerializedName("active")
*/
public $active;

/**
* @var int
*
* @Form\Type("int")
* @Form\SerializedName("sinceId")
*/
public $sinceId;
}
33 changes: 33 additions & 0 deletions src/Model/Request/Store/OffersRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* PHP version 7.3
*
* @category OffersRequest
* @package RetailCrm\Api\Model\Request\Store
*/

namespace RetailCrm\Api\Model\Request\Store;

use RetailCrm\Api\Component\FormData\Mapping as Form;
use RetailCrm\Api\Interfaces\RequestInterface;
use RetailCrm\Api\Model\Request\Traits\PageLimitTrait;

/**
* Class OffersRequest
*
* @category OffersRequest
* @package RetailCrm\Api\Model\Request\Store
*/
class OffersRequest implements RequestInterface
{
use PageLimitTrait;

/**
* @var \RetailCrm\Api\Model\Filter\Store\OfferFilterType
*
* @Form\Type("RetailCrm\Api\Model\Filter\Store\OfferFilterType")
* @Form\SerializedName("filter")
*/
public $filter;
}
30 changes: 30 additions & 0 deletions src/Model/Response/Store/OffersResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* PHP version 7.3
*
* @category OffersResponse
* @package RetailCrm\Api\Model\Response\Store
*/

namespace RetailCrm\Api\Model\Response\Store;

use RetailCrm\Api\Component\Serializer\Annotation as JMS;
use RetailCrm\Api\Model\Response\AbstractPaginatedResponse;

/**
* Class OffersResponse
*
* @category OffersResponse
* @package RetailCrm\Api\Model\Response\Store
*/
class OffersResponse extends AbstractPaginatedResponse
{
/**
* @var \RetailCrm\Api\Model\Entity\Store\StoreOffer[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Store\StoreOffer>")
* @JMS\SerializedName("offers")
*/
public $offers;
}
Loading

0 comments on commit 927b078

Please sign in to comment.