1
0
mirror of synced 2024-11-21 21:06:07 +03:00

Сorrections for two namespaces & visible and variative fields

This commit is contained in:
Alex Lushpai 2021-11-16 12:42:24 +03:00 committed by GitHub
commit 649b60b392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 145 additions and 63 deletions

View File

@ -0,0 +1,77 @@
<?php
/**
* PHP version 7.3
*
* @category ProductProperty
* @package RetailCrm\Api\Model\Entity\Store
*/
namespace RetailCrm\Api\Model\Entity\Store;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
/**
* Class ProductProperty
*
* @category ProductProperty
* @package RetailCrm\Api\Model\Entity\Store
*/
class ProductProperty
{
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("sites")
*/
public $sites;
/**
* @var \RetailCrm\Api\Model\Entity\Store\ProductPropertyGroup[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Store\ProductPropertyGroup>")
* @JMS\SerializedName("groups")
*/
public $groups;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("code")
*/
public $code;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("name")
*/
public $name;
/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("isNumeric")
*/
public $isNumeric;
/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("visible")
*/
public $visible;
/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("variative")
*/
public $variative;
}

View File

@ -0,0 +1,37 @@
<?php
/**
* PHP version 7.3
*
* @category ProductPropertyGroup
* @package RetailCrm\Api\Model\Entity\Store
*/
namespace RetailCrm\Api\Model\Entity\Store;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
/**
* Class ProductPropertyGroup
*
* @category ProductPropertyGroup
* @package RetailCrm\Api\Model\Entity\Store
*/
class ProductPropertyGroup
{
/**
* @var int
*
* @JMS\Type("int")
* @JMS\SerializedName("id")
*/
public $id;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("name")
*/
public $name;
}

View File

@ -35,6 +35,22 @@ class ProductPropertiesFilterType
*/
public $code;
/**
* @var int
*
* @Form\Type("int")
* @Form\SerializedName("visible")
*/
public $visible;
/**
* @var int
*
* @Form\Type("int")
* @Form\SerializedName("variative")
*/
public $variative;
/**
* @var string[]
*

View File

@ -9,53 +9,15 @@
namespace RetailCrm\Api\Model\Filter\Store;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
use RetailCrm\Api\Model\Entity\Store\ProductProperty as Base;
/**
* Class ProductProperty
*
* @category ProductProperty
* @package RetailCrm\Api\Model\Filter\Store
* @deprecated Please use RetailCrm\Api\Model\Entity\Store\ProductProperty instead.
*/
class ProductProperty
class ProductProperty extends Base
{
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("sites")
*/
public $sites;
/**
* @var \RetailCrm\Api\Model\Filter\Store\ProductPropertyGroup[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Filter\Store\ProductPropertyGroup>")
* @JMS\SerializedName("groups")
*/
public $groups;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("code")
*/
public $code;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("name")
*/
public $name;
/**
* @var bool
*
* @JMS\Type("bool")
* @JMS\SerializedName("isNumeric")
*/
public $isNumeric;
}

View File

@ -9,29 +9,15 @@
namespace RetailCrm\Api\Model\Filter\Store;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
use RetailCrm\Api\Model\Entity\Store\ProductPropertyGroup as Base;
/**
* Class ProductPropertyGroup
*
* @category ProductPropertyGroup
* @package RetailCrm\Api\Model\Filter\Store
* @deprecated Please use RetailCrm\Api\Model\Entity\Store\ProductPropertyGroup instead.
*/
class ProductPropertyGroup
class ProductPropertyGroup extends Base
{
/**
* @var int
*
* @JMS\Type("int")
* @JMS\SerializedName("id")
*/
public $id;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("name")
*/
public $name;
}

View File

@ -21,9 +21,9 @@ use RetailCrm\Api\Model\Response\AbstractPaginatedResponse;
class ProductPropertiesResponse extends AbstractPaginatedResponse
{
/**
* @var \RetailCrm\Api\Model\Filter\Store\ProductProperty[]
* @var \RetailCrm\Api\Model\Entity\Store\ProductProperty[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Filter\Store\ProductProperty>")
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Store\ProductProperty>")
* @JMS\SerializedName("properties")
*/
public $properties;

View File

@ -597,15 +597,19 @@ EOF;
],
"code": "code",
"name": "Код",
"isNumeric": false
"isNumeric": false,
"visible": true,
"variative": true
}
]
}
EOF;
$request = new ProductPropertiesRequest();
$request->filter = new ProductPropertiesFilterType();
$request = new ProductPropertiesRequest();
$request->filter = new ProductPropertiesFilterType();
$request->filter->sites = ['moysklad', 'aliexpress'];
$request->filter->visible = NumericBoolean::TRUE;
$request->filter->variative = NumericBoolean::TRUE;
$mock = static::createApiMockBuilder('store/products/properties');
$mock->matchMethod(RequestMethod::GET)