Skip to content

Commit b7f13e4

Browse files
committed
Rename sku and qty request interface.
1 parent 57da390 commit b7f13e4

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

InventorySales/Model/AreProductsSalableForRequestedQty/ProductsSalableRequest.php renamed to InventorySales/Model/AreProductsSalableForRequestedQty/ProductsSalableInfo.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace Magento\InventorySales\Model\AreProductsSalableForRequestedQty;
99

10-
use Magento\InventorySalesApi\Api\Data\SkuQtyRequestExtensionInterface;
11-
use Magento\InventorySalesApi\Api\Data\SkuQtyRequestInterface;
10+
use Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoExtensionInterface;
11+
use Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoInterface;
1212

1313
/**
1414
* @inheritDoc
1515
*/
16-
class ProductsSalableRequest implements SkuQtyRequestInterface
16+
class ProductsSalableInfo implements ProductSalableForRequestedQtyInfoInterface
1717
{
1818
/**
1919
* @var string
@@ -26,14 +26,14 @@ class ProductsSalableRequest implements SkuQtyRequestInterface
2626
private $qty;
2727

2828
/**
29-
* @var SkuQtyRequestExtensionInterface|null
29+
* @var ProductSalableForRequestedQtyInfoExtensionInterface|null
3030
*/
3131
private $extensionAttributes;
3232

3333
/**
3434
* @param string $sku
3535
* @param float $qty
36-
* @param SkuQtyRequestExtensionInterface|null $extensionAttributes
36+
* @param ProductSalableForRequestedQtyInfoExtensionInterface|null $extensionAttributes
3737
*/
3838
public function __construct(string $sku, float $qty, $extensionAttributes = null)
3939
{
@@ -62,15 +62,15 @@ public function getQty(): float
6262
* @inheritDoc
6363
*/
6464
public function setExtensionAttributes(
65-
SkuQtyRequestExtensionInterface $extensionAttributes
65+
ProductSalableForRequestedQtyInfoExtensionInterface $extAttributes
6666
): void {
67-
$this->extensionAttributes = $extensionAttributes;
67+
$this->extensionAttributes = $extAttributes;
6868
}
6969

7070
/**
7171
* @inheritDoc
7272
*/
73-
public function getExtensionAttributes(): ?SkuQtyRequestExtensionInterface
73+
public function getExtensionAttributes(): ?ProductSalableForRequestedQtyInfoExtensionInterface
7474
{
7575
return $this->extensionAttributes;
7676
}

InventorySales/Model/CheckItemsQuantity.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\InventorySalesApi\Api\AreProductsSalableForRequestedQtyInterface;
1313
use Magento\InventorySalesApi\Api\Data\ProductSalabilityErrorInterface;
14-
use Magento\InventorySalesApi\Api\Data\SkuQtyRequestInterfaceFactory;
14+
use Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoInterfaceFactory;
1515
use Magento\InventorySalesApi\Api\IsProductSalableForRequestedQtyInterface;
1616

1717
/**
@@ -25,25 +25,25 @@ class CheckItemsQuantity
2525
private $areProductsSalableForRequestedQty;
2626

2727
/**
28-
* @var SkuQtyRequestInterfaceFactory
28+
* @var ProductSalableForRequestedQtyInfoInterfaceFactory
2929
*/
30-
private $skuQtyRequestFactory;
30+
private $salableForRequestedQtyInfoFactory;
3131

3232
/**
3333
* @param IsProductSalableForRequestedQtyInterface $isProductSalableForRequestedQty @deprecated
34-
* @param SkuQtyRequestInterfaceFactory|null $skuQtyRequestFactory
34+
* @param ProductSalableForRequestedQtyInfoInterfaceFactory|null $salableForRequestedQtyInfoFactory
3535
* @param AreProductsSalableForRequestedQtyInterface $areProductsSalableForRequestedQty
3636
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3737
*/
3838
public function __construct(
3939
IsProductSalableForRequestedQtyInterface $isProductSalableForRequestedQty,
40-
SkuQtyRequestInterfaceFactory $skuQtyRequestFactory = null,
40+
ProductSalableForRequestedQtyInfoInterfaceFactory $salableForRequestedQtyInfoFactory = null,
4141
AreProductsSalableForRequestedQtyInterface $areProductsSalableForRequestedQty = null
4242
) {
4343
$this->areProductsSalableForRequestedQty = $areProductsSalableForRequestedQty ?: ObjectManager::getInstance()
4444
->get(AreProductsSalableForRequestedQtyInterface::class);
45-
$this->skuQtyRequestFactory = $skuQtyRequestFactory ?: ObjectManager::getInstance()
46-
->get(SkuQtyRequestInterfaceFactory::class);
45+
$this->salableForRequestedQtyInfoFactory = $salableForRequestedQtyInfoFactory ?: ObjectManager::getInstance()
46+
->get(ProductSalableForRequestedQtyInfoInterfaceFactory::class);
4747
}
4848

4949
/**
@@ -58,7 +58,7 @@ public function execute(array $items, int $stockId): void
5858
{
5959
$skuRequests = [];
6060
foreach ($items as $sku => $qty) {
61-
$skuRequests[] = $this->skuQtyRequestFactory->create(['sku' => $sku, 'qty' => $qty]);
61+
$skuRequests[] = $this->salableForRequestedQtyInfoFactory->create(['sku' => $sku, 'qty' => $qty]);
6262
}
6363
$result = $this->areProductsSalableForRequestedQty->execute($skuRequests, $stockId);
6464
foreach ($result->getSalable() as $isSalable) {

InventorySales/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,5 @@
186186
</type>
187187
<preference for="Magento\InventorySalesApi\Api\Data\ProductsSalableResultInterface" type="Magento\InventorySales\Model\ProductsSalableResult"/>
188188
<preference for="Magento\InventorySalesApi\Api\Data\IsProductSalableResultInterface" type="Magento\InventorySales\Model\ProductSalableResult"/>
189-
<preference for="Magento\InventorySalesApi\Api\Data\SkuQtyRequestInterface" type="Magento\InventorySales\Model\AreProductsSalableForRequestedQty\ProductsSalableRequest"/>
189+
<preference for="Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoInterface" type="Magento\InventorySales\Model\AreProductsSalableForRequestedQty\ProductsSalableInfo"/>
190190
</config>

InventorySalesApi/Api/AreProductsSalableForRequestedQtyInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface AreProductsSalableForRequestedQtyInterface
1919
/**
2020
* Get whether products are salable in requested Qty for given set of SKUs in specified stock.
2121
*
22-
* @param \Magento\InventorySalesApi\Api\Data\SkuQtyRequestInterface[] $skuRequests
22+
* @param \Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoInterface[] $skuRequests
2323
* @param int $stockId
2424
* @return \Magento\InventorySalesApi\Api\Data\ProductsSalableResultInterface
2525
*/

InventorySalesApi/Api/Data/SkuQtyRequestInterface.php renamed to InventorySalesApi/Api/Data/ProductSalableForRequestedQtyInfoInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* @api
1616
*/
17-
interface SkuQtyRequestInterface extends ExtensibleDataInterface
17+
interface ProductSalableForRequestedQtyInfoInterface extends ExtensibleDataInterface
1818
{
1919
/**
2020
* Retrieve product sku.
@@ -33,17 +33,17 @@ public function getQty(): float;
3333
/**
3434
* Set extension attributes to result.
3535
*
36-
* @param \Magento\InventorySalesApi\Api\Data\SkuQtyRequestExtensionInterface $extensionAttributes
36+
* @param \Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoExtensionInterface $extAttributes
3737
* @return void
3838
*/
3939
public function setExtensionAttributes(
40-
SkuQtyRequestExtensionInterface $extensionAttributes
40+
ProductSalableForRequestedQtyInfoExtensionInterface $extAttributes
4141
): void;
4242

4343
/**
4444
* Retrieve existing extension attributes object.
4545
*
46-
* @return \Magento\InventorySalesApi\Api\Data\SkuQtyRequestExtensionInterface|null
46+
* @return \Magento\InventorySalesApi\Api\Data\ProductSalableForRequestedQtyInfoExtensionInterface|null
4747
*/
48-
public function getExtensionAttributes(): ?SkuQtyRequestExtensionInterface;
48+
public function getExtensionAttributes(): ?ProductSalableForRequestedQtyInfoExtensionInterface;
4949
}

0 commit comments

Comments
 (0)