diff --git a/src/Model/Entity/Store/ProductProperty.php b/src/Model/Entity/Store/ProductProperty.php new file mode 100644 index 0000000..0431913 --- /dev/null +++ b/src/Model/Entity/Store/ProductProperty.php @@ -0,0 +1,77 @@ +") + * @JMS\SerializedName("sites") + */ + public $sites; + + /** + * @var \RetailCrm\Api\Model\Entity\Store\ProductPropertyGroup[] + * + * @JMS\Type("array") + * @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; +} diff --git a/src/Model/Entity/Store/ProductPropertyGroup.php b/src/Model/Entity/Store/ProductPropertyGroup.php new file mode 100644 index 0000000..b0f035e --- /dev/null +++ b/src/Model/Entity/Store/ProductPropertyGroup.php @@ -0,0 +1,37 @@ +") - * @JMS\SerializedName("sites") - */ - public $sites; - - /** - * @var \RetailCrm\Api\Model\Filter\Store\ProductPropertyGroup[] - * - * @JMS\Type("array") - * @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; } diff --git a/src/Model/Filter/Store/ProductPropertyGroup.php b/src/Model/Filter/Store/ProductPropertyGroup.php index f2467b1..14a025e 100644 --- a/src/Model/Filter/Store/ProductPropertyGroup.php +++ b/src/Model/Filter/Store/ProductPropertyGroup.php @@ -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; } diff --git a/src/Model/Response/Store/ProductPropertiesResponse.php b/src/Model/Response/Store/ProductPropertiesResponse.php index 877d264..3f2b493 100644 --- a/src/Model/Response/Store/ProductPropertiesResponse.php +++ b/src/Model/Response/Store/ProductPropertiesResponse.php @@ -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") + * @JMS\Type("array") * @JMS\SerializedName("properties") */ public $properties; diff --git a/tests/src/ResourceGroup/StoreTest.php b/tests/src/ResourceGroup/StoreTest.php index bdd1599..d5a8968 100644 --- a/tests/src/ResourceGroup/StoreTest.php +++ b/tests/src/ResourceGroup/StoreTest.php @@ -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)