Add support for new filters of GET /api/v5/store/offers method
(#205)
* Add support for new filters of GET /api/v5/store/offers method - filter[min/maxPrice] - filter[priceType] - filter[min/maxQuantity] - filter[catalogs][] --------- Co-authored-by: Kirill Sukhorukov <suhorukov@retailcrm.ru>
This commit is contained in:
parent
1c6ebd819f
commit
6130b265fe
@ -36,6 +36,14 @@ class Product
|
||||
*/
|
||||
public $maxPrice;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @JMS\Type("int")
|
||||
* @JMS\SerializedName("catalogId")
|
||||
*/
|
||||
public $catalogId;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
|
@ -68,6 +68,14 @@ class OfferFilterType
|
||||
*/
|
||||
public $sites;
|
||||
|
||||
/**
|
||||
* @var int[]
|
||||
*
|
||||
* @Form\Type("int[]")
|
||||
* @Form\SerializedName("catalogs")
|
||||
*/
|
||||
public $catalogs;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
@ -83,4 +91,52 @@ class OfferFilterType
|
||||
* @Form\SerializedName("sinceId")
|
||||
*/
|
||||
public $sinceId;
|
||||
|
||||
/**
|
||||
* @var int[]
|
||||
*
|
||||
* @Form\Type("int[]")
|
||||
* @Form\SerializedName("groups")
|
||||
*/
|
||||
public $groups;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Form\Type("string")
|
||||
* @Form\SerializedName("priceType")
|
||||
*/
|
||||
public $priceType;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Form\Type("int")
|
||||
* @Form\SerializedName("minPrice")
|
||||
*/
|
||||
public $minPrice;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Form\Type("int")
|
||||
* @Form\SerializedName("maxPrice")
|
||||
*/
|
||||
public $maxPrice;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Form\Type("int")
|
||||
* @Form\SerializedName("minQuantity")
|
||||
*/
|
||||
public $minQuantity;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Form\Type("int")
|
||||
* @Form\SerializedName("maxQuantity")
|
||||
*/
|
||||
public $maxQuantity;
|
||||
}
|
||||
|
@ -943,11 +943,24 @@ EOF;
|
||||
$request = new OffersRequest();
|
||||
$request->filter = new OfferFilterType();
|
||||
$request->filter->active = NumericBoolean::TRUE;
|
||||
$request->filter->name = 'Test Offer';
|
||||
$request->filter->minPrice = 1;
|
||||
$request->filter->maxPrice = 120000;
|
||||
$request->filter->sites = ['main'];
|
||||
$request->filter->maxQuantity = 5;
|
||||
$request->filter->catalogs = [2];
|
||||
|
||||
$mock = static::createApiMockBuilder('store/offers');
|
||||
$mock->matchMethod(RequestMethod::GET)
|
||||
->matchQuery(self::encodeFormArray($request))
|
||||
->matchQuery([
|
||||
'filter' => [
|
||||
'sites' => ['main'],
|
||||
'catalogs' => ['2'],
|
||||
'active' => '1',
|
||||
'minPrice' => '1',
|
||||
'maxPrice' => '120000',
|
||||
'maxQuantity' => '5',
|
||||
]
|
||||
])
|
||||
->reply(200)
|
||||
->withBody($json);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user