From ea0cbaac0f24da398ca72d882e02591e5919df88 Mon Sep 17 00:00:00 2001 From: hitarthpattani Date: Wed, 6 Mar 2019 09:01:02 +0000 Subject: [PATCH] Resolve issues based on comments received --- .../Data/ImportStatusResponseInterface.php | 18 ++++++++-- .../ImportStatusResponseItemInterface.php | 34 +++++++++++++------ .../Api/ImportStatusInterface.php | 6 ++-- .../ImportService/Model/ImportStatus.php | 13 +++++-- .../Model/ImportStatusResponse.php | 26 ++++++++++---- .../Model/ImportStatusResponseItem.php | 34 +++++++++++++------ 6 files changed, 95 insertions(+), 36 deletions(-) diff --git a/app/code/Magento/ImportService/Api/Data/ImportStatusResponseInterface.php b/app/code/Magento/ImportService/Api/Data/ImportStatusResponseInterface.php index 65225c02e06..ecb97edf7a3 100644 --- a/app/code/Magento/ImportService/Api/Data/ImportStatusResponseInterface.php +++ b/app/code/Magento/ImportService/Api/Data/ImportStatusResponseInterface.php @@ -32,7 +32,7 @@ interface ImportStatusResponseInterface public function getStatus(); /** - * Get error + * Get error if there is any with import process * * @return string|null */ @@ -46,7 +46,7 @@ public function getError(); public function getUuid(); /** - * Get entity type + * Get imported entity type * * @return string */ @@ -74,42 +74,56 @@ public function getUserType(); public function getItems(); /** + * Set import process status + * * @param string $status * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setStatus($status); /** + * Set import process error if there is any + * * @param string $error * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setError($error); /** + * Set uuid + * * @param int $uuid * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setUuid($uuid); /** + * Set imported entity type + * * @param string $entityType * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setEntityType($entityType); /** + * Set user id + * * @param int $userId * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setUserId($userId); /** + * Set user type + * * @param int $userType * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ public function setUserType($userType); /** + * Set imported items + * * @param \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface[] $items * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ diff --git a/app/code/Magento/ImportService/Api/Data/ImportStatusResponseItemInterface.php b/app/code/Magento/ImportService/Api/Data/ImportStatusResponseItemInterface.php index 6a9abd902b8..021979be4bb 100644 --- a/app/code/Magento/ImportService/Api/Data/ImportStatusResponseItemInterface.php +++ b/app/code/Magento/ImportService/Api/Data/ImportStatusResponseItemInterface.php @@ -22,28 +22,28 @@ interface ImportStatusResponseItemInterface /** * Get uuid * - * @return int|null + * @return int */ public function getUuid(); /** * Get status * - * @return string|null + * @return string */ public function getStatus(); /** * Get serialized data * - * @return string|null + * @return string */ public function getSerializedData(); /** * Get serialized data result * - * @return string|null + * @return string */ public function getResultSerializedData(); @@ -57,42 +57,54 @@ public function getErrorCode(); /** * Get result message * - * @return string|null + * @return string */ public function getResultMessage(); /** - * @param $uuid + * Set uuid + * + * @param int $uuid * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setUuid($uuid); /** - * @param $status + * Set imported status + * + * @param string $status * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setStatus($status); /** - * @param $serializedData + * Set serialized data + * + * @param string $serializedData * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setSerializedData($serializedData); /** - * @param $resultSerializedData + * Set serialized result data + * + * @param string $resultSerializedData * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setResultSerializedData($resultSerializedData); /** - * @param $errorCode + * Set error code if occured + * + * @param string $errorCode * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setErrorCode($errorCode); /** - * @param $resultMessage + * Set result message for process + * + * @param string $resultMessage * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface */ public function setResultMessage($resultMessage); diff --git a/app/code/Magento/ImportService/Api/ImportStatusInterface.php b/app/code/Magento/ImportService/Api/ImportStatusInterface.php index fd9b16219c7..977558cd307 100644 --- a/app/code/Magento/ImportService/Api/ImportStatusInterface.php +++ b/app/code/Magento/ImportService/Api/ImportStatusInterface.php @@ -13,10 +13,10 @@ interface ImportStatusInterface { /** - * Get source status. + * Get import source status. * - * @param string $uuid + * @param int $uuid * @return \Magento\ImportService\Api\Data\ImportStatusResponseInterface */ - public function execute(string $uuid); + public function execute(int $uuid); } diff --git a/app/code/Magento/ImportService/Model/ImportStatus.php b/app/code/Magento/ImportService/Model/ImportStatus.php index 2da7ff6640d..38cb5344a6f 100644 --- a/app/code/Magento/ImportService/Model/ImportStatus.php +++ b/app/code/Magento/ImportService/Model/ImportStatus.php @@ -18,18 +18,23 @@ */ class ImportStatus implements ImportStatusInterface { - /** + /** + * Import response factory instance + * * @var ImportStatusResponse */ private $responseFactory; /** + * Import response item factory instance + * * @var ImportStatusResponseItem */ private $responseItemFactory; /** * Status constructor. + * * @param ImportStatusResponseFactory $responseFactory * @param ImportStatusResponseItemFactory $responseItemFactory */ @@ -42,10 +47,12 @@ public function __construct( } /** - * @param string $uuid + * Get import source status. + * + * @param int $uuid * @return ImportStatusResponseFactory */ - public function execute(string $uuid) + public function execute(int $uuid) { // Create new response object $response = $this->responseFactory->create(); diff --git a/app/code/Magento/ImportService/Model/ImportStatusResponse.php b/app/code/Magento/ImportService/Model/ImportStatusResponse.php index 0c24787f7fe..e43039a17f0 100644 --- a/app/code/Magento/ImportService/Model/ImportStatusResponse.php +++ b/app/code/Magento/ImportService/Model/ImportStatusResponse.php @@ -13,7 +13,7 @@ class ImportStatusResponse extends AbstractModel implements ImportStatusResponseInterface { /** - * Get status + * Get import status * * @return string */ @@ -23,7 +23,7 @@ public function getStatus() } /** - * Get error + * Get error if there is any with import process * * @return string|null */ @@ -43,7 +43,7 @@ public function getUuid() } /** - * Get entity type + * Get imported entity type * * @return string */ @@ -53,7 +53,7 @@ public function getEntityType() } /** - * Get user id + * Retrieve current user ID * * @return int */ @@ -63,7 +63,7 @@ public function getUserId() } /** - * Get user type + * Retrieve current user type * * @return int */ @@ -73,7 +73,7 @@ public function getUserType() } /** - * Get items + * Get import items status * * @return \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface[] */ @@ -83,6 +83,8 @@ public function getItems() } /** + * Set import process status + * * @param string $status * @return $this */ @@ -92,6 +94,8 @@ public function setStatus($status) } /** + * Set import process error if there is any + * * @param string $error * @return $this */ @@ -101,6 +105,8 @@ public function setError($error) } /** + * Set uuid + * * @param int $uuid * @return $this */ @@ -110,6 +116,8 @@ public function setUuid($uuid) } /** + * Set imported entity type + * * @param string $entityType * @return $this */ @@ -119,6 +127,8 @@ public function setEntityType($entityType) } /** + * Set user id + * * @param int $userId * @return $this */ @@ -128,6 +138,8 @@ public function setUserId($userId) } /** + * Set user type + * * @param int $userType * @return $this */ @@ -137,6 +149,8 @@ public function setUserType($userType) } /** + * Set imported items + * * @param \Magento\ImportService\Api\Data\ImportStatusResponseItemInterface[] $items * @return $this */ diff --git a/app/code/Magento/ImportService/Model/ImportStatusResponseItem.php b/app/code/Magento/ImportService/Model/ImportStatusResponseItem.php index 15b96743cd3..37543be3e86 100644 --- a/app/code/Magento/ImportService/Model/ImportStatusResponseItem.php +++ b/app/code/Magento/ImportService/Model/ImportStatusResponseItem.php @@ -15,7 +15,7 @@ class ImportStatusResponseItem extends AbstractModel implements ImportStatusResp /** * Get uuid * - * @return int|null + * @return int */ public function getUuid() { @@ -25,7 +25,7 @@ public function getUuid() /** * Get status * - * @return string|null + * @return string */ public function getStatus() { @@ -35,7 +35,7 @@ public function getStatus() /** * Get serialized data * - * @return string|null + * @return string */ public function getSerializedData() { @@ -45,7 +45,7 @@ public function getSerializedData() /** * Get serialized data result * - * @return string|null + * @return string */ public function getResultSerializedData() { @@ -65,7 +65,7 @@ public function getErrorCode() /** * Get result message * - * @return string|null + * @return string */ public function getResultMessage() { @@ -73,7 +73,9 @@ public function getResultMessage() } /** - * @param $uuid + * Set uuid + * + * @param int $uuid * @return $this */ public function setUuid($uuid) @@ -82,7 +84,9 @@ public function setUuid($uuid) } /** - * @param $status + * Set imported status + * + * @param string $status * @return $this */ public function setStatus($status) @@ -91,7 +95,9 @@ public function setStatus($status) } /** - * @param $serializedData + * Set serialized data + * + * @param string $serializedData * @return $this */ public function setSerializedData($serializedData) @@ -100,7 +106,9 @@ public function setSerializedData($serializedData) } /** - * @param $resultSerializedData + * Set serialized result data + * + * @param string $resultSerializedData * @return $this */ public function setResultSerializedData($resultSerializedData) @@ -109,7 +117,9 @@ public function setResultSerializedData($resultSerializedData) } /** - * @param $errorCode + * Set error code if occured + * + * @param string $errorCode * @return $this */ public function setErrorCode($errorCode) @@ -118,7 +128,9 @@ public function setErrorCode($errorCode) } /** - * @param $resultMessage + * Set result message for process + * + * @param string $resultMessage * @return $this */ public function setResultMessage($resultMessage)