Support for filtering product properties by groups and sorting by usage in offers
This commit is contained in:
commit
5b04bd9d8a
@ -66,4 +66,12 @@ class ProductPropertiesFilterType
|
||||
* @Form\SerializedName("catalogs")
|
||||
*/
|
||||
public $catalogs;
|
||||
|
||||
/**
|
||||
* @var int[]
|
||||
*
|
||||
* @Form\Type("int[]")
|
||||
* @Form\SerializedName("groups")
|
||||
*/
|
||||
public $groups;
|
||||
}
|
||||
|
@ -23,6 +23,14 @@ class ProductPropertiesRequest implements RequestInterface
|
||||
{
|
||||
use PageLimitTrait;
|
||||
|
||||
/**
|
||||
* @var ProductPropertiesSort
|
||||
*
|
||||
* @Form\Type("ProductPropertiesSort")
|
||||
* @Form\SerializedName("sort")
|
||||
*/
|
||||
public $sort;
|
||||
|
||||
/**
|
||||
* @var \RetailCrm\Api\Model\Filter\Store\ProductPropertiesFilterType
|
||||
*
|
||||
|
31
src/Model/Request/Store/ProductPropertiesSort.php
Normal file
31
src/Model/Request/Store/ProductPropertiesSort.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.3
|
||||
*
|
||||
* @category ProductPropertiesRequest
|
||||
* @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 ProductPropertiesSort
|
||||
*
|
||||
* @category ProductPropertiesRequest
|
||||
* @package RetailCrm\Api\Model\Request\Store
|
||||
*/
|
||||
class ProductPropertiesSort implements RequestInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Form\Type("string")
|
||||
* @Form\SerializedName("offersCount")
|
||||
*/
|
||||
public $offersCount;
|
||||
}
|
@ -33,6 +33,7 @@ use RetailCrm\Api\Model\Request\Store\ProductGroupsCreateRequest;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductGroupsEditRequest;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductGroupsRequest;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductPropertiesRequest;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductPropertiesSort;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest;
|
||||
use RetailCrm\Api\Model\Request\Store\ProductsRequest;
|
||||
use RetailCrm\TestUtils\Factory\TestClientFactory;
|
||||
@ -616,10 +617,14 @@ EOF;
|
||||
EOF;
|
||||
|
||||
$request = new ProductPropertiesRequest();
|
||||
$request->sort = new ProductPropertiesSort();
|
||||
$request->sort->offersCount = 'desc';
|
||||
|
||||
$request->filter = new ProductPropertiesFilterType();
|
||||
$request->filter->sites = ['moysklad', 'aliexpress'];
|
||||
$request->filter->visible = NumericBoolean::TRUE;
|
||||
$request->filter->variative = NumericBoolean::TRUE;
|
||||
$request->filter->groups = [3676, 3679, 3680, 3724];
|
||||
|
||||
$mock = static::createApiMockBuilder('store/products/properties');
|
||||
$mock->matchMethod(RequestMethod::GET)
|
||||
|
Loading…
Reference in New Issue
Block a user