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

added type property to Product and ProductBatchModel

This commit is contained in:
Pavel 2024-01-18 16:08:45 +03:00 committed by GitHub
commit 72636563ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
/**
* PHP 7.3
*
* @category PaymentInvoiceType
* @package RetailCrm\Api\Enum\Payments
*/
namespace RetailCrm\Api\Enum\Payments;
/**
* Class PaymentInvoiceType
*
* @category PaymentInvoiceType
* @package RetailCrm\Api\Enum\Payments
*/
final class PaymentObjectType
{
public const COMMODITY = 'commodity';
public const SERVICE = 'service';
public const PAYMENT = 'payment';
}

View File

@ -0,0 +1,22 @@
<?php
/**
* PHP version 7.3
*
* @category CallEventType
* @package RetailCrm\Api\Enum\Telephony
*/
namespace RetailCrm\Api\Enum\Product;
/**
* Class CallEventType
*
* @category CallEventType
* @package RetailCrm\Api\Enum\Telephony
*/
final class ProductType
{
public const PRODUCT = 'product';
public const SERVICE = 'service';
}

View File

@ -187,4 +187,12 @@ class Product
* @JMS\SerializedName("updatedAt") * @JMS\SerializedName("updatedAt")
*/ */
public $updatedAt; public $updatedAt;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("type")
*/
public $type;
} }

View File

@ -130,4 +130,12 @@ abstract class ProductBatchBase
* @JMS\SerializedName("catalogId") * @JMS\SerializedName("catalogId")
*/ */
public $catalogId; public $catalogId;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("type")
*/
public $type;
} }

View File

@ -629,6 +629,7 @@ class Store extends AbstractApiResourceGroup
* use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest; * use RetailCrm\Api\Model\Request\Store\ProductsBatchCreateRequest;
* use RetailCrm\Api\Factory\SimpleClientFactory; * use RetailCrm\Api\Factory\SimpleClientFactory;
* use RetailCrm\Api\Interfaces\ApiExceptionInterface; * use RetailCrm\Api\Interfaces\ApiExceptionInterface;
* use RetailCrm\Api\Enum\Product\ProductType;
* *
* $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey');
* *
@ -646,6 +647,7 @@ class Store extends AbstractApiResourceGroup
* $productInput->popular = true; * $productInput->popular = true;
* $productInput->recommended = true; * $productInput->recommended = true;
* $productInput->stock = true; * $productInput->stock = true;
* $productInput->type = ProductType::PRODUCT;
* $productEditGroupInput = new ProductEditGroupInput(); * $productEditGroupInput = new ProductEditGroupInput();
* $productEditGroupInput->externalId = 'testExternalId'; * $productEditGroupInput->externalId = 'testExternalId';
* $productEditGroupInput->id = 10; * $productEditGroupInput->id = 10;

View File

@ -11,6 +11,7 @@ namespace RetailCrm\Tests\ResourceGroup;
use RetailCrm\Api\Component\Transformer\DateTimeTransformer; use RetailCrm\Api\Component\Transformer\DateTimeTransformer;
use RetailCrm\Api\Enum\NumericBoolean; use RetailCrm\Api\Enum\NumericBoolean;
use RetailCrm\Api\Enum\Product\ProductType;
use RetailCrm\Api\Enum\RequestMethod; use RetailCrm\Api\Enum\RequestMethod;
use RetailCrm\Api\Model\Entity\Store\Inventory; use RetailCrm\Api\Model\Entity\Store\Inventory;
use RetailCrm\Api\Model\Entity\Store\Offer; use RetailCrm\Api\Model\Entity\Store\Offer;
@ -375,6 +376,7 @@ EOF;
"maxPrice": 624, "maxPrice": 624,
"id": 828272, "id": 828272,
"article": "38311", "article": "38311",
"type": "product",
"name": "Test Product", "name": "Test Product",
"url": "https://example.com", "url": "https://example.com",
"imageUrl": "https://example.com/image.jpg", "imageUrl": "https://example.com/image.jpg",
@ -699,6 +701,7 @@ EOF;
$productInput->popular = true; $productInput->popular = true;
$productInput->recommended = true; $productInput->recommended = true;
$productInput->stock = true; $productInput->stock = true;
$productInput->type = ProductType::PRODUCT;
$productEditGroupInput = new ProductEditGroupInput(); $productEditGroupInput = new ProductEditGroupInput();
$productEditGroupInput->id = 9717; $productEditGroupInput->id = 9717;