1
0
Fork 0
mirror of synced 2025-04-04 14:23:40 +03:00

add filter[catalogs][]

This commit is contained in:
Ruslan Efanov 2024-08-26 17:18:57 +03:00
parent da8ce13736
commit e7f4a8da1c
3 changed files with 31 additions and 2 deletions

View file

@ -36,6 +36,14 @@ class Product
*/
public $maxPrice;
/**
* @var int
*
* @JMS\Type("int")
* @JMS\SerializedName("catalogId")
*/
public $catalogId;
/**
* @var int
*

View file

@ -68,6 +68,14 @@ class OfferFilterType
*/
public $sites;
/**
* @var int[]
*
* @Form\Type("int[]")
* @Form\SerializedName("catalogs")
*/
public $catalogs;
/**
* @var int
*

View file

@ -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);