1
0
mirror of synced 2024-11-27 23:36:02 +03:00

Product methods implementation

* aliexpress.solution.product.list.get
* aliexpress.solution.product.list.get
* aliexpress.solution.product.info.get (not all fields in response data)
* aliexpress.solution.batch.product.inventory.update
* aliexpress.solution.batch.product.price.update
This commit is contained in:
altqq885 2021-03-04 14:59:18 +03:00 committed by GitHub
parent b0e69213da
commit 0eff0e82a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 1584 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<?php
/**
* PHP version 7.3
*
* @category MultipleProductInventoriesUpdateListQuery
* @package RetailCrm\Model\Request\AliExpress\Data
*/
namespace RetailCrm\Model\Request\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class MultipleProductInventoriesUpdateListQuery
*
* @category MultipleProductInventoriesUpdateListQuery
* @package RetailCrm\Model\Request\AliExpress\Data
*/
class MultipleProductInventoriesUpdateListQuery
{
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
* @Assert\NotNull()
*/
public $productId;
/**
* @var \RetailCrm\Model\Request\AliExpress\Data\SkuStocksUpdateItemDto[] $multipleSkuUpdateList
*
* @JMS\Type("array<RetailCrm\Model\Request\AliExpress\Data\SkuStocksUpdateItemDto>")
* @JMS\SerializedName("multiple_sku_update_list")
* @Assert\NotNull()
*/
public $multipleSkuUpdateList;
}

View File

@ -0,0 +1,36 @@
<?php
/**
* PHP version 7.3
*
* @category MultipleProductUpdateListQuery
* @package RetailCrm\Model\Request\AliExpress\Data
*/
namespace RetailCrm\Model\Request\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
/**
* Class MultipleProductUpdateListQuery
*
* @category MultipleProductUpdateListQuery
* @package RetailCrm\Model\Request\AliExpress\Data
*/
class MultipleProductUpdateListQuery
{
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
/**
* @var \RetailCrm\Model\Request\AliExpress\Data\SkuPricesUpdateItemDto[] $multipleSkuUpdateList
*
* @JMS\Type("array<RetailCrm\Model\Request\AliExpress\Data\SkuPricesUpdateItemDto>")
* @JMS\SerializedName("multiple_sku_update_list")
*/
public $multipleSkuUpdateList;
}

View File

@ -0,0 +1,160 @@
<?php
/**
* PHP version 7.3
*
* @category ProductGetQuery
* @package RetailCrm\Model\Request\AliExpress\Data
*/
namespace RetailCrm\Model\Request\AliExpress\Data;
use DateTime;
use JMS\Serializer\Annotation as JMS;
use Symfony\Component\Validator\Constraints as Assert;
use RetailCrm\Component\Validator\Constraints as TopAssert;
/**
* Class ProductGetQuery
*
* @category ProductGetQuery
* @package RetailCrm\Model\Request\AliExpress\Data
* @SuppressWarnings(PHPMD.TooManyFields)
*/
class ProductGetQuery
{
/**
* @var DateTime $gmtCreateEnd
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_create_end")
* @TopAssert\Timezone("PST")
*/
public $gmtCreateEnd;
/**
* @var DateTime $gmtCreateStart
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_create_start")
* @TopAssert\Timezone("PST")
*/
public $gmtCreateStart;
/**
* @var DateTime $gmtModifiedStart
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_modified_start")
* @TopAssert\Timezone("PST")
*/
public $modifiedDateStart;
/**
* @var int $pageSize
*
* @JMS\Type("int")
* @JMS\SerializedName("page_size")
* @Assert\GreaterThan(0)
*/
public $pageSize;
/**
* @var DateTime $gmtModifiedEnd
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_modified_end")
* @TopAssert\Timezone("PST")
*/
public $gmtModifiedEnd;
/**
* @var int $currentPage
*
* @JMS\Type("int")
* @JMS\SerializedName("current_page")
* @Assert\GreaterThan(0)
*/
public $currentPage;
/**
* @var string $skuCode
*
* @JMS\Type("string")
* @JMS\SerializedName("sku_code")
*/
public $skuCode;
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
/**
* @var int $groupId
*
* @JMS\Type("int")
* @JMS\SerializedName("group_id")
*/
public $groupId;
/**
* @var string $productStatusType
*
* @JMS\Type("string")
* @JMS\SerializedName("product_status_type")
* @Assert\Choice({"onSelling", "offline", "auditing", "editingRequired"})
* @Assert\NotBlank()
*/
public $productStatusType;
/**
* @var string $subject
*
* @JMS\Type("string")
* @JMS\SerializedName("subject")
*/
public $subject;
/**
* @var string $wsDisplay
*
* @JMS\Type("string")
* @JMS\SerializedName("ws_display")
*/
public $wsDisplay;
/**
* @var string $haveNationalQuote
*
* @JMS\Type("string")
* @JMS\SerializedName("have_national_quote")
*/
public $haveNationalQuote;
/**
* @var string $ownerMemberId
*
* @JMS\Type("string")
* @JMS\SerializedName("owner_member_id")
*/
public $ownerMemberId;
/**
* @var int $offlineTime
*
* @JMS\Type("int")
* @JMS\SerializedName("off_line_time")
*/
public $offlineTime;
/**
* @var int[] $exceptedProductIds
*
* @JMS\Type("array<int>")
* @JMS\SerializedName("excepted_product_ids")
*/
public $exceptedProductIds;
}

View File

@ -0,0 +1,50 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductInventoryUpdate
* @package RetailCrm\Model\Request\AliExpress
*/
namespace RetailCrm\Model\Request\AliExpress;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Request\BaseRequest;
use RetailCrm\Model\Response\AliExpress\SolutionBatchProductInventoryUpdateResponse;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class SolutionBatchProductInventoryUpdate
*
* @category SolutionBatchProductInventoryUpdate
* @package RetailCrm\Model\Request\AliExpress
*/
class SolutionBatchProductInventoryUpdate extends BaseRequest
{
/**
* @see https://developers.aliexpress.com/en/doc.htm?docId=45135&docType=2&ocId=45140
*
* @var \RetailCrm\Model\Request\AliExpress\Data\MultipleProductInventoriesUpdateListQuery $mutipleProductUpdateList
*
* @JMS\Type("RetailCrm\Model\Request\AliExpress\Data\MultipleProductInventoriesUpdateListQuery")
* @JMS\SerializedName("mutiple_product_update_list")
* @Assert\NotNull()
*/
public $mutipleProductUpdateList;
/**
* @inheritDoc
*/
public function getMethod(): string
{
return 'aliexpress.solution.batch.product.inventory.update';
}
/**
* @inheritDoc
*/
public function getExpectedResponse(): string
{
return SolutionBatchProductInventoryUpdateResponse::class;
}
}

View File

@ -0,0 +1,48 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductPriceUpdate
* @package RetailCrm\Model\Request\AliExpress
*/
namespace RetailCrm\Model\Request\AliExpress;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Request\BaseRequest;
use RetailCrm\Model\Response\AliExpress\SolutionBatchProductPriceUpdateResponse;
/**
* Class SolutionBatchProductPriceUpdate
*
* @category SolutionBatchProductPriceUpdate
* @package RetailCrm\Model\Request\AliExpress
*/
class SolutionBatchProductPriceUpdate extends BaseRequest
{
/**
* @see https://developers.aliexpress.com/en/doc.htm?docId=45140&docType=2&ocId=45140
*
* @var \RetailCrm\Model\Request\AliExpress\Data\MultipleProductUpdateListQuery $mutipleProductUpdateList
*
* @JMS\Type("RetailCrm\Model\Request\AliExpress\Data\MultipleProductUpdateListQuery")
* @JMS\SerializedName("mutiple_product_update_list")
*/
public $mutipleProductUpdateList;
/**
* @inheritDoc
*/
public function getMethod(): string
{
return 'aliexpress.solution.batch.product.price.update';
}
/**
* @inheritDoc
*/
public function getExpectedResponse(): string
{
return SolutionBatchProductPriceUpdateResponse::class;
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductInfoGet
* @package RetailCrm\Model\Request\AliExpress
*/
namespace RetailCrm\Model\Request\AliExpress;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Request\BaseRequest;
use RetailCrm\Model\Response\AliExpress\SolutionProductInfoGetResponse;
/**
* Class SolutionProductInfoGet
*
* @category SolutionProductInfoGet
* @package RetailCrm\Model\Request\AliExpress
*/
class SolutionProductInfoGet extends BaseRequest
{
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
/**
* @inheritDoc
*/
public function getMethod(): string
{
return 'aliexpress.solution.product.info.get';
}
/**
* @inheritDoc
*/
public function getExpectedResponse(): string
{
return SolutionProductInfoGetResponse::class;
}
}

View File

@ -0,0 +1,48 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductListGet
* @package RetailCrm\Model\Request\AliExpress
*/
namespace RetailCrm\Model\Request\AliExpress;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Request\BaseRequest;
use RetailCrm\Model\Response\AliExpress\SolutionProductListGetResponse;
/**
* Class SolutionProductListGet
*
* @category SolutionProductListGet
* @package RetailCrm\Model\Request\AliExpress
*/
class SolutionProductListGet extends BaseRequest
{
/**
* @see https://developers.aliexpress.com/en/doc.htm?docId=42384&docType=2
*
* @var \RetailCrm\Model\Request\AliExpress\Data\ProductGetQuery $aeopAEProductListQuery
*
* @JMS\Type("RetailCrm\Model\Request\AliExpress\Data\ProductGetQuery")
* @JMS\SerializedName("aeop_a_e_product_list_query")
*/
public $aeopAEProductListQuery;
/**
* @inheritDoc
*/
public function getMethod(): string
{
return 'aliexpress.solution.product.list.get';
}
/**
* @inheritDoc
*/
public function getExpectedResponse(): string
{
return SolutionProductListGetResponse::class;
}
}

View File

@ -0,0 +1,61 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductInventoryUpdateResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
namespace RetailCrm\Model\Response\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionBatchProductInventoryUpdateResponseData
*
* @category SolutionBatchProductInventoryUpdateResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
class SolutionBatchProductInventoryUpdateResponseData
{
/**
* @var string $updateErrorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("update_error_code")
*/
public $updateErrorCode;
/**
* @var string $updateErrorMessage
*
* @JMS\Type("string")
* @JMS\SerializedName("update_error_message")
*/
public $updateErrorMessage;
/**
* @var string $updateSuccess
*
* @JMS\Type("boolean")
* @JMS\SerializedName("update_success")
*/
public $updateSuccess;
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList $updateFailedList
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList")
* @JMS\SerializedName("update_failed_list")
*/
public $updateFailedList;
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList $updateSuccessfulList
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList")
* @JMS\SerializedName("update_successful_list")
*/
public $updateSuccessfulList;
}

View File

@ -0,0 +1,61 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductPriceUpdateResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
namespace RetailCrm\Model\Response\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionBatchProductPriceUpdateResponseData
*
* @category SolutionBatchProductPriceUpdateResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
class SolutionBatchProductPriceUpdateResponseData
{
/**
* @var string $updateErrorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("update_error_code")
*/
public $updateErrorCode;
/**
* @var string $updateErrorMessage
*
* @JMS\Type("string")
* @JMS\SerializedName("update_error_message")
*/
public $updateErrorMessage;
/**
* @var string $updateSuccess
*
* @JMS\Type("boolean")
* @JMS\SerializedName("update_success")
*/
public $updateSuccess;
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList $updateFailedList
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList")
* @JMS\SerializedName("update_failed_list")
*/
public $updateFailedList;
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList $updateSuccessfulList
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseList")
* @JMS\SerializedName("update_successful_list")
*/
public $updateSuccessfulList;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductInfoGetResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
namespace RetailCrm\Model\Response\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionProductInfoGetResponseData
*
* @category SolutionProductInfoGetResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
class SolutionProductInfoGetResponseData
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\SolutionProductInfoGetResponseResult $result
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\SolutionProductInfoGetResponseResult")
* @JMS\SerializedName("result")
*/
public $result;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductListGetResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
namespace RetailCrm\Model\Response\AliExpress\Data;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionProductListGetResponseData
*
* @category SolutionProductListGetResponseData
* @package RetailCrm\Model\Response\AliExpress\Data
*/
class SolutionProductListGetResponseData
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\SolutionProductListGetResponseResult $result
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\SolutionProductListGetResponseResult")
* @JMS\SerializedName("result")
*/
public $result;
}

View File

@ -0,0 +1,158 @@
<?php
/**
* PHP version 7.3
*
* @category ItemDisplayDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use DateTime;
use JMS\Serializer\Annotation as JMS;
/**
* Class ItemDisplayDto
*
* @category ItemDisplayDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
* @SuppressWarnings(PHPMD.TooManyFields)
*/
class ItemDisplayDto
{
/**
* @var DateTime $wsOfflineDate
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("ws_offline_date")
*/
public $wsOfflineDate;
/**
* @var DateTime $gmtModified
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_modified")
*/
public $gmtModified;
/**
* @var DateTime $gmtCreate
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("gmt_create")
*/
public $gmtCreate;
/**
* @var DateTime $couponStartDate
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("coupon_start_date")
*/
public $couponStartDate;
/**
* @var DateTime $couponEndDate
*
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
* @JMS\SerializedName("coupon_end_date")
*/
public $couponEndDate;
/**
* @var string $wsDisplay
*
* @JMS\Type("string")
* @JMS\SerializedName("ws_display")
*/
public $wsDisplay;
/**
* @var string $subject
*
* @JMS\Type("string")
* @JMS\SerializedName("subject")
*/
public $subject;
/**
* @var string $src
*
* @JMS\Type("string")
* @JMS\SerializedName("src")
*/
public $src;
/**
* @var string $productMinPrice
*
* @JMS\Type("string")
* @JMS\SerializedName("product_min_price")
*/
public $productMinPrice;
/**
* @var string $productMaxPrice
*
* @JMS\Type("string")
* @JMS\SerializedName("product_max_price")
*/
public $productMaxPrice;
/**
* @var string $ownerMemberSeq
*
* @JMS\Type("string")
* @JMS\SerializedName("owner_member_seq")
*/
public $ownerMemberSeq;
/**
* @var string $ownerMemberId
*
* @JMS\Type("string")
* @JMS\SerializedName("owner_member_id")
*/
public $ownerMemberId;
/**
* @var string $imageUrls
*
* @JMS\Type("string")
* @JMS\SerializedName("image_u_r_ls")
*/
public $imageUrls;
/**
* @var string $currencyCode
*
* @JMS\Type("string")
* @JMS\SerializedName("currency_code")
*/
public $currencyCode;
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
/**
* @var int $groupId
*
* @JMS\Type("int")
* @JMS\SerializedName("group")
*/
public $groupId;
/**
* @var int $freightTemplateId
*
* @JMS\Type("int")
* @JMS\SerializedName("freight_template_id")
*/
public $freightTemplateId;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP version 7.3
*
* @category ItemDisplayDtoList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use JMS\Serializer\Annotation as JMS;
/**
* Class ItemDisplayDtoList
*
* @category ItemDisplayDtoList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
class ItemDisplayDtoList
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\ItemDisplayDto[] $itemDisplayDto
*
* @JMS\Type("array<RetailCrm\Model\Response\AliExpress\Result\Entity\ItemDisplayDto>")
* @JMS\SerializedName("item_display_dto")
*/
public $itemDisplayDto;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP version 7.3
*
* @category ProductSkuDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use JMS\Serializer\Annotation as JMS;
/**
* Class ProductSkuDto
*
* @category ProductSkuDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
class ProductSkuDto
{
/**
* @var string $skuCode
*
* @JMS\Type("string")
* @JMS\SerializedName("sku_code")
*/
public $skuCode;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP version 7.3
*
* @category ProductSkuDtoList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use JMS\Serializer\Annotation as JMS;
/**
* Class ProductSkuDtoList
*
* @category ProductSkuDtoList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
class ProductSkuDtoList
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\ProductSkuDto[] $globalAeopAEProductSku
*
* @JMS\Type("array<RetailCrm\Model\Response\AliExpress\Result\Entity\ProductSkuDto>")
* @JMS\SerializedName("global_aeop_ae_product_sku")
*/
public $globalAeopAEProductSku;
}

View File

@ -0,0 +1,42 @@
<?php
/**
* PHP version 7.3
*
* @category SynchronizeProductResponseDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use JMS\Serializer\Annotation as JMS;
/**
* Class SynchronizeProductResponseDto
*
* @category SynchronizeProductResponseDto
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
class SynchronizeProductResponseDto
{
/**
* @var string $errorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("error_code")
*/
public $errorCode;
/**
* @var string $errorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("error_message")
*/
public $errorMessage;
/**
* @var int $errorCode
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
}

View File

@ -0,0 +1,29 @@
<?php
/**
* PHP version 7.3
*
* @category SynchronizeProductResponseList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
namespace RetailCrm\Model\Response\AliExpress\Result\Entity;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseDto;
/**
* Class SynchronizeProductResponseList
*
* @category SynchronizeProductResponseList
* @package RetailCrm\Model\Response\AliExpress\Result\Entity
*/
class SynchronizeProductResponseList
{
/**
* @var SynchronizeProductResponseDto[] $synchronizeProductResponseDto
*
* @JMS\Type("array<RetailCrm\Model\Response\AliExpress\Result\Entity\SynchronizeProductResponseDto>")
* @JMS\SerializedName("synchronize_product_response_dto")
*/
public $synchronizeProductResponseDto;
}

View File

@ -0,0 +1,70 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductInfoGetResponseResult
* @package RetailCrm\Model\Response\AliExpress\Result
*/
namespace RetailCrm\Model\Response\AliExpress\Result;
use RetailCrm\Model\Response\AliExpress\Result\Interfaces\ErrorInterface;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Response\AliExpress\Result\Traits\SuccessTrait;
/**
* Class SolutionProductInfoGetResponseResult
*
* @category SolutionProductInfoGetResponseResult
* @package RetailCrm\Model\Response\AliExpress\Result
*/
class SolutionProductInfoGetResponseResult implements ErrorInterface
{
use SuccessTrait;
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\ProductSkuDtoList $aeopAEProductSkus
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\ProductSkuDtoList")
* @JMS\SerializedName("aeop_ae_product_s_k_us")
*/
public $aeopAEProductSkus;
/**
* @var int $productId
*
* @JMS\Type("int")
* @JMS\SerializedName("product_id")
*/
public $productId;
public $errorMsg;
/**
* @var string errorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("error_code")
*/
public $errorCode;
/**
* ErrorInterface implementation.
*
* @return ?string
*/
public function getErrorCode(): ?string
{
return $this->errorCode;
}
/**
* ErrorInterface implementation.
*
* @return ?string
*/
public function getErrorMessage(): ?string
{
return $this->errorMsg;
}
}

View File

@ -0,0 +1,92 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductListGetResponseResult
* @package RetailCrm\Model\Response\AliExpress\Result
*/
namespace RetailCrm\Model\Response\AliExpress\Result;
use RetailCrm\Model\Response\AliExpress\Result\Interfaces\ErrorInterface;
use JMS\Serializer\Annotation as JMS;
use RetailCrm\Model\Response\AliExpress\Result\Traits\SuccessTrait;
/**
* Class SolutionProductListGetResponseResult
*
* @category SolutionProductListGetResponseResult
* @package RetailCrm\Model\Response\AliExpress\Result
*/
class SolutionProductListGetResponseResult implements ErrorInterface
{
use SuccessTrait;
/**
* @var int $productCount
*
* @JMS\Type("int")
* @JMS\SerializedName("product_count")
*/
public $productCount;
/**
* @var int $currentPage
*
* @JMS\Type("int")
* @JMS\SerializedName("current_page")
*/
public $currentPage;
/**
* @var int $totalPage
*
* @JMS\Type("int")
* @JMS\SerializedName("total_page")
*/
public $totalPage;
/**
* @var string $errorMsg
*
* @JMS\Type("string")
* @JMS\SerializedName("error_msg")
*/
public $errorMsg;
/**
* @var string errorCode
*
* @JMS\Type("string")
* @JMS\SerializedName("error_code")
*/
public $errorCode;
/**
* ErrorInterface implementation.
*
* @return ?string
*/
public function getErrorCode(): ?string
{
return $this->errorCode;
}
/**
* ErrorInterface implementation.
*
* @return ?string
*/
public function getErrorMessage(): ?string
{
return $this->errorMsg;
}
/**
* @var \RetailCrm\Model\Response\AliExpress\Result\Entity\ItemDisplayDtoList $aeopAEProductDisplayDtoList
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Result\Entity\ItemDisplayDtoList")
* @JMS\SerializedName("aeop_a_e_product_display_d_t_o_list")
*/
public $aeopAEProductDisplayDtoList;
}

View File

@ -0,0 +1,29 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductInventoryUpdateResponse
* @package RetailCrm\Model\Response\AliExpress
*/
namespace RetailCrm\Model\Response\AliExpress;
use RetailCrm\Model\Response\BaseResponse;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionBatchProductInventoryUpdateResponse
*
* @category SolutionBatchProductInventoryUpdateResponse
* @package RetailCrm\Model\Response\AliExpress
*/
class SolutionBatchProductInventoryUpdateResponse extends BaseResponse
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Data\SolutionBatchProductInventoryUpdateResponseData $responseData
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Data\SolutionBatchProductInventoryUpdateResponseData")
* @JMS\SerializedName("aliexpress_solution_batch_product_inventory_update_response")
*/
public $responseData;
}

View File

@ -0,0 +1,29 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionBatchProductPriceUpdateResponse
* @package RetailCrm\Model\Response\AliExpress
*/
namespace RetailCrm\Model\Response\AliExpress;
use RetailCrm\Model\Response\BaseResponse;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionBatchProductPriceUpdateResponse
*
* @category SolutionBatchProductPriceUpdateResponse
* @package RetailCrm\Model\Response\AliExpress
*/
class SolutionBatchProductPriceUpdateResponse extends BaseResponse
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Data\SolutionBatchProductPriceUpdateResponseData $responseData
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Data\SolutionBatchProductPriceUpdateResponseData")
* @JMS\SerializedName("aliexpress_solution_batch_product_price_update_response")
*/
public $responseData;
}

View File

@ -0,0 +1,29 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductInfoGetResponse
* @package RetailCrm\Model\Response\AliExpress
*/
namespace RetailCrm\Model\Response\AliExpress;
use RetailCrm\Model\Response\BaseResponse;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionProductInfoGetResponse
*
* @category SolutionProductInfoGetResponse
* @package RetailCrm\Model\Response\AliExpress
*/
class SolutionProductInfoGetResponse extends BaseResponse
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Data\SolutionProductInfoGetResponseData $responseData
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Data\SolutionProductInfoGetResponseData")
* @JMS\SerializedName("aliexpress_solution_product_info_get_response")
*/
public $responseData;
}

View File

@ -0,0 +1,29 @@
<?php
/**
* PHP version 7.3
*
* @category SolutionProductListGetResponse
* @package RetailCrm\Model\Response\AliExpress
*/
namespace RetailCrm\Model\Response\AliExpress;
use RetailCrm\Model\Response\BaseResponse;
use JMS\Serializer\Annotation as JMS;
/**
* Class SolutionProductListGetResponse
*
* @category SolutionProductListGetResponse
* @package RetailCrm\Model\Response\AliExpress
*/
class SolutionProductListGetResponse extends BaseResponse
{
/**
* @var \RetailCrm\Model\Response\AliExpress\Data\SolutionProductListGetResponseData $responseData
*
* @JMS\Type("RetailCrm\Model\Response\AliExpress\Data\SolutionProductListGetResponseData")
* @JMS\SerializedName("aliexpress_solution_product_list_get_response")
*/
public $responseData;
}

View File

@ -27,6 +27,8 @@ use RetailCrm\Model\Request\AliExpress\LogisticsDsTrackingInfoQuery;
use RetailCrm\Model\Request\AliExpress\LogisticsRedefiningListLogisticsService;
use RetailCrm\Model\Request\AliExpress\PostproductRedefiningCategoryForecast;
use RetailCrm\Model\Request\AliExpress\PostproductRedefiningFindAEProductByIdForDropshipper;
use RetailCrm\Model\Request\AliExpress\SolutionBatchProductInventoryUpdate;
use RetailCrm\Model\Request\AliExpress\SolutionBatchProductPriceUpdate;
use RetailCrm\Model\Request\AliExpress\SolutionFeedListGet;
use RetailCrm\Model\Request\AliExpress\SolutionFeedQuery;
use RetailCrm\Model\Request\AliExpress\SolutionFeedSubmit;
@ -34,6 +36,8 @@ use RetailCrm\Model\Request\AliExpress\SolutionMerchantProfileGet;
use RetailCrm\Model\Request\AliExpress\SolutionOrderFulfill;
use RetailCrm\Model\Request\AliExpress\SolutionOrderGet;
use RetailCrm\Model\Request\AliExpress\SolutionOrderReceiptInfoGet;
use RetailCrm\Model\Request\AliExpress\SolutionProductInfoGet;
use RetailCrm\Model\Request\AliExpress\SolutionProductListGet;
use RetailCrm\Model\Request\AliExpress\SolutionProductSchemaGet;
use RetailCrm\Model\Request\AliExpress\SolutionSellerCategoryTreeQuery;
use RetailCrm\Model\Request\Taobao\HttpDnsGetRequest;
@ -1095,4 +1099,388 @@ EOF;
self::assertEquals('official', $response->responseData->shopType);
self::assertEquals('//www.aliexpress.com/store/1234321', $response->responseData->shopUrl);
}
public function testAliexpressSolutionProductListGet()
{
$json = <<<'EOF'
{
"aliexpress_solution_product_list_get_response":{
"result":{
"error_message":"",
"error_code":16009999,
"total_page":100,
"success":true,
"product_count":1201,
"error_msg":"0",
"current_page":10,
"aeop_a_e_product_display_d_t_o_list":{
"item_display_dto":[
{
"ws_offline_date":"2021-01-01 12:13:14",
"ws_display":"0",
"subject":"knew odd",
"src":"0",
"product_min_price":"0",
"product_max_price":"0",
"product_id":23453463456346546,
"owner_member_seq":0,
"owner_member_id":"0",
"image_u_r_ls":"0",
"group_id":123,
"gmt_modified":"2021-01-01 12:13:14",
"gmt_create":"2021-01-01 12:13:14",
"freight_template_id":0,
"currency_code":"USD;RUB",
"coupon_start_date":"2021-01-01 12:13:14",
"coupon_end_date":"2021-01-01 12:13:14"
}
]
}
}
}
}
EOF;
$mock = self::getMockClient();
$mock->on(
RequestMatcher::createMatcher('api.taobao.com')
->setPath('/router/rest')
->setOptionalPostFields([
'app_key' => self::getEnvAppKey(),
'method' => 'aliexpress.solution.product.list.get',
'session' => self::getEnvToken()
]),
$this->responseJson(200, $json)
);
$client = TopClientBuilder::create()
->setContainer($this->getContainer($mock))
->setAppData($this->getEnvAppData())
->setAuthenticator($this->getEnvTokenAuthenticator())
->build();
/** @var \RetailCrm\Model\Response\AliExpress\SolutionProductListGetResponse $response */
$response = $client->sendAuthenticatedRequest(new SolutionProductListGet());
self::assertEquals(true, $response->responseData->result->success);
self::assertEquals(1201, $response->responseData->result->productCount);
$items = $response->responseData->result->aeopAEProductDisplayDtoList->itemDisplayDto;
self::assertIsArray($items);
self::assertCount(1, $items);
self::assertEquals(23453463456346546, $items[0]->productId);
}
public function testAliexpressSolutionProductInfoGet()
{
$json = <<<'EOF'
{
"aliexpress_solution_product_info_get_response":{
"result":{
"add_unit":11,
"add_weight":"11.11",
"aeop_a_e_multimedia":{
"aeop_a_e_videos":{
"global_aeop_ae_video":[
{
"ali_member_id":1006680305,
"media_id":12345678,
"media_status":"approved",
"media_type":"video",
"poster_url":"http:\/\/img01.taobaocdn.com\/bao\/uploaded\/TB1rNdGIVXXXXbTXFXXXXXXXXXX.jpg"
}
]
}
},
"aeop_ae_product_propertys":{
"global_aeop_ae_product_property":[
{
"attr_name":"size",
"attr_name_id":200000043,
"attr_value":"2 - 5 kg",
"attr_value_id":493,
"attr_value_unit":"0"
}
]
},
"aeop_ae_product_s_k_us":{
"global_aeop_ae_product_sku":[
{
"aeop_s_k_u_property_list":{
"global_aeop_sku_property":[
{
"property_value_definition_name":"pink",
"property_value_id":366,
"sku_image":"http:\/\/ae01.alicdn.com\/kf\/HTB19KVYX6LuK1Rjy0Fhq6xpdFXac.jpg",
"sku_property_id":14
}
]
},
"barcode":"0",
"currency_code":"USD",
"id":"\"200000182:193;200007763:201336100\"",
"ipm_sku_stock":1234,
"sku_code":"ffff00978",
"sku_price":"200.07",
"sku_stock":true,
"sku_discount_price":"10.01"
},
{
"aeop_s_k_u_property_list":{
"global_aeop_sku_property":[
{
"property_value_definition_name":"pink",
"property_value_id":366,
"sku_image":"http:\/\/ae01.alicdn.com\/kf\/HTB19KVYX6LuK1Rjy0Fhq6xpdFXac.jpg",
"sku_property_id":14
}
]
},
"barcode":"0",
"currency_code":"USD",
"id":"\"200000182:193;200007763:201336100\"",
"ipm_sku_stock":1234,
"sku_code":"cfas00978",
"sku_price":"200.07",
"sku_stock":true,
"sku_discount_price":"10.01"
}
]
},
"base_unit":2,
"bulk_discount":90,
"bulk_order":10,
"category_id":123456,
"currency_code":"USD",
"delivery_time":60,
"detail":"<div><\/div>",
"freight_template_id":12345,
"gmt_create":"2018-12-03 15:17:33",
"gmt_modified":"2018-12-18 17:11:08",
"gross_weight":"40.12",
"group_id":10023,
"group_ids":{
"number":[
[1002141,
10024524]
]
},
"image_u_r_ls":"http:\/\/g01.a.alicdn.com\/kf\/HTB13GKLJXXXXXbYaXXXq6xXFXXXi.jpg;http:\/\/g02.a.alicdn.com\/kf\/HTB1DkaWJXXXXXb6XFXXq6xXFXXXp.jpg;http:\/\/g02.a.alicdn.com\/kf\/HTB1pMCQJXXXXXcvXVXXq6xXFXXXm.jpg;http:\/\/g03.a.alicdn.com\/kf\/HTB1QhORJXXXXXbiXVXXq6xXFXXXx.jpg;http:\/\/g02.a.alicdn.com\/kf\/HTB1q1aLJXXXXXcfaXXXq6xXFXXXv.jpg",
"is_pack_sell":true,
"lot_num":1,
"mobile_detail":"balalaba",
"owner_member_id":"aliqatest01",
"owner_member_seq":1006680305,
"package_height":30,
"package_length":10,
"package_width":20,
"product_id":1234,
"product_price":"10.23",
"product_status_type":"onSelling",
"product_unit":100000015,
"promise_template_id":100,
"reduce_strategy":"place_order_withhold或payment_success_deduct",
"sizechart_id":123,
"subject":"English description",
"ws_offline_date":"2018-12-19 11:24:27",
"package_type":true,
"multi_language_subject_list":{
"global_subject":[
{
"locale":"es_ES",
"subject":"Versión Global Xiaomi Redmi Note 5"
}
]
},
"multi_language_description_list":{
"global_description":[
{
"locale":"es_ES",
"mobile_detail":"{\"version\":\"2.0.0\",\"moduleList\":[{\"type\":\"html\",\"html\":{\"content\":\"Versión Global Xiaomi Redmi Note 5\"}}]}",
"web_detail":"{\"version\":\"2.0.0\",\"moduleList\":[{\"type\":\"html\",\"html\":{\"content\":\"Versión Global Xiaomi Redmi Note 5\"}}]}"
}
]
},
"multi_country_price_configuration":{
"price_type":"absolute",
"country_price_list":{
"single_country_price_dto":[
{
"ship_to_country":"ES",
"sku_price_by_country_list":{
"single_sku_price_by_country_dto":[
{
"sku_code":"abc123",
"price":"16",
"discount_price":"12.99"
}
]
}
}
]
}
}
}
}
}
EOF;
$mock = self::getMockClient();
$mock->on(
RequestMatcher::createMatcher('api.taobao.com')
->setPath('/router/rest')
->setOptionalPostFields([
'app_key' => self::getEnvAppKey(),
'method' => 'aliexpress.solution.product.info.get',
'session' => self::getEnvToken()
]),
$this->responseJson(200, $json)
);
$client = TopClientBuilder::create()
->setContainer($this->getContainer($mock))
->setAppData($this->getEnvAppData())
->setAuthenticator($this->getEnvTokenAuthenticator())
->build();
/** @var \RetailCrm\Model\Response\AliExpress\SolutionProductInfoGetResponse $response */
$response = $client->sendAuthenticatedRequest(new SolutionProductInfoGet());
$skuList = $response->responseData->result->aeopAEProductSkus->globalAeopAEProductSku;
self::assertIsArray($skuList);
self::assertCount(2, $skuList);
self::assertNotNull($skuList[0]->skuCode);
self::assertNotNull($skuList[1]->skuCode);
}
public function testAliexpressSolutionBatchProductInventoryUpdate()
{
$json = <<<'EOF'
{
"aliexpress_solution_batch_product_inventory_update_response":{
"update_error_code":"",
"update_error_message":"",
"update_success": true,
"update_failed_list":{
"synchronize_product_response_dto":[
{
"error_code":"",
"error_message":"message",
"product_id": 123
},
{
"error_code":"",
"error_message":"message",
"product_id":1234
}
]
},
"update_successful_list":{
"synchronize_product_response_dto":[
{
"product_id": 123
}
]
}
}
}
EOF;
$mock = self::getMockClient();
$mock->on(
RequestMatcher::createMatcher('api.taobao.com')
->setPath('/router/rest')
->setOptionalPostFields([
'app_key' => self::getEnvAppKey(),
'method' => 'aliexpress.solution.batch.product.inventory.update',
'session' => self::getEnvToken()
]),
$this->responseJson(200, $json)
);
$client = TopClientBuilder::create()
->setContainer($this->getContainer($mock))
->setAppData($this->getEnvAppData())
->setAuthenticator($this->getEnvTokenAuthenticator())
->build();
/** @var \RetailCrm\Model\Response\AliExpress\SolutionBatchProductInventoryUpdateResponse $response */
$response = $client->sendAuthenticatedRequest(new SolutionBatchProductInventoryUpdate());
self::assertTrue($response->responseData->updateSuccess);
$updateSuccessfulList = $response->responseData->updateSuccessfulList->synchronizeProductResponseDto;
$updateFailedList = $response->responseData->updateFailedList->synchronizeProductResponseDto;
self::assertIsArray($updateSuccessfulList);
self::assertIsArray($updateFailedList);
self::assertCount(1, $updateSuccessfulList);
self::assertCount(2, $updateFailedList);
self::assertNotNull($updateFailedList[0]->productId);
self::assertNotNull($updateFailedList[0]->errorMessage);
self::assertNotNull($updateFailedList[1]->productId);
self::assertNotNull($updateFailedList[1]->errorMessage);
self::assertNotNull($updateSuccessfulList[0]->productId);
}
public function testAliexpressSolutionBatchProductPriceUpdate()
{
$json = <<<'EOF'
{
"aliexpress_solution_batch_product_price_update_response":{
"update_error_code":"",
"update_error_message":"",
"update_success": true,
"update_failed_list":{
"synchronize_product_response_dto":[
{
"error_code":"",
"error_message":"message",
"product_id": 123
},
{
"error_code":"",
"error_message":"message",
"product_id":1234
}
]
},
"update_successful_list":{
"synchronize_product_response_dto":[
{
"product_id": 123
}
]
}
}
}
EOF;
$mock = self::getMockClient();
$mock->on(
RequestMatcher::createMatcher('api.taobao.com')
->setPath('/router/rest')
->setOptionalPostFields([
'app_key' => self::getEnvAppKey(),
'method' => 'aliexpress.solution.batch.product.price.update',
'session' => self::getEnvToken()
]),
$this->responseJson(200, $json)
);
$client = TopClientBuilder::create()
->setContainer($this->getContainer($mock))
->setAppData($this->getEnvAppData())
->setAuthenticator($this->getEnvTokenAuthenticator())
->build();
/** @var \RetailCrm\Model\Response\AliExpress\SolutionBatchProductPriceUpdateResponse $response */
$response = $client->sendAuthenticatedRequest(new SolutionBatchProductPriceUpdate());
self::assertTrue($response->responseData->updateSuccess);
$updateSuccessfulList = $response->responseData->updateSuccessfulList->synchronizeProductResponseDto;
$updateFailedList = $response->responseData->updateFailedList->synchronizeProductResponseDto;
self::assertIsArray($updateSuccessfulList);
self::assertIsArray($updateFailedList);
self::assertCount(1, $updateSuccessfulList);
self::assertCount(2, $updateFailedList);
self::assertNotNull($updateFailedList[0]->productId);
self::assertNotNull($updateFailedList[0]->errorMessage);
self::assertNotNull($updateFailedList[1]->productId);
self::assertNotNull($updateFailedList[1]->errorMessage);
self::assertNotNull($updateSuccessfulList[0]->productId);
}
}