Skip to content

Commit b533c11

Browse files
author
Valeriy Nayda
committed
Merge remote-tracking branch 'origin/develop' into saleschannels-integration-with-api
# Conflicts: # app/code/Magento/InventorySales/Ui/Component/Listing/Column/SalesChannels.php # app/code/Magento/InventorySales/etc/di.xml
2 parents df14d78 + fb81eee commit b533c11

32 files changed

+380
-318
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\InventoryApi\Api\Data;
9+
10+
/**
11+
* TODO: temporal fix of extension classes generation during installation
12+
* Extension class for @see \Magento\InventoryApi\Api\Data\StockInterface
13+
*/
14+
class StockExtension extends \Magento\Framework\Api\AbstractSimpleObject implements StockExtensionInterface
15+
{
16+
/**
17+
* @return \Magento\InventorySalesApi\Api\Data\SalesChannelInterface[]|null
18+
*/
19+
public function getSalesChannels()
20+
{
21+
return $this->_get('sales_channels');
22+
}
23+
24+
/**
25+
* @param \Magento\InventorySalesApi\Api\Data\SalesChannelInterface[] $salesChannels
26+
* @return $this
27+
*/
28+
public function setSalesChannels($salesChannels)
29+
{
30+
$this->setData('sales_channels', $salesChannels);
31+
return $this;
32+
}
33+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\InventoryApi\Api\Data;
9+
10+
/**
11+
* TODO: temporal fix of extension classes generation during installation
12+
* ExtensionInterface class for @see \Magento\InventoryApi\Api\Data\StockInterface
13+
*/
14+
interface StockExtensionInterface extends \Magento\Framework\Api\ExtensionAttributesInterface
15+
{
16+
/**
17+
* @return \Magento\InventorySalesApi\Api\Data\SalesChannelInterface[]|null
18+
*/
19+
public function getSalesChannels();
20+
21+
/**
22+
* @param \Magento\InventorySalesApi\Api\Data\SalesChannelInterface[] $salesChannels
23+
* @return $this
24+
*/
25+
public function setSalesChannels($salesChannels);
26+
}

app/code/Magento/InventoryApi/Test/Api/SourceRepository/CreateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function tearDown()
7272
{
7373
/** @var ResourceConnection $connection */
7474
$connection = Bootstrap::getObjectManager()->get(ResourceConnection::class);
75-
$connection->getConnection()->delete('inventory_source', [
75+
$connection->getConnection()->delete($connection->getTableName('inventory_source'), [
7676
SourceInterface::NAME . ' IN (?)' => ['source-name-1'],
7777
]);
7878
parent::tearDown();

app/code/Magento/InventoryApi/Test/Api/SourceRepository/RegionProcessingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function tearDown()
8282
{
8383
/** @var ResourceConnection $connection */
8484
$connection = Bootstrap::getObjectManager()->get(ResourceConnection::class);
85-
$connection->getConnection()->delete('inventory_source', [
85+
$connection->getConnection()->delete($connection->getTableName('inventory_source'), [
8686
SourceInterface::NAME . ' IN (?)' => ['source-name-1'],
8787
]);
8888
parent::tearDown();

app/code/Magento/InventoryCatalog/etc/module.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_InventoryCatalog" setup_version="1.0.0" />
9+
<module name="Magento_InventoryCatalog" setup_version="2.0.0">
10+
<sequence>
11+
<module name="InventorySales"/>
12+
</sequence>
13+
</module>
1014
</config>

app/code/Magento/InventorySales/Model/GetAssignedSalesChannelsForStock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\InventorySalesApi\Api\Data\SalesChannelInterfaceFactory;
1212
use Magento\InventorySalesApi\Api\Data\SalesChannelInterface;
1313

14+
/**
15+
* @inheritdoc
16+
*/
1417
class GetAssignedSalesChannelsForStock implements GetAssignedSalesChannelsForStockInterface
1518
{
1619
/**

app/code/Magento/InventorySales/Model/GetAssignedSalesChannelsForStockInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Magento\InventorySalesApi\Api\Data\SalesChannelInterface;
1111

1212
/**
13-
* TODO: describe SPI
14-
* Get assigned Sales Channels for Stock
13+
* Get assigned Sales Channels for Stock (Service Provider Interface - SPI)
14+
* Provide own implementation of this interface if you would like to replace channels management strategy
1515
*
1616
* @api
1717
*/

app/code/Magento/InventorySales/Model/OptionSource/WebsiteSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function toOptionArray(): array
4242
}
4343
$websites[] = [
4444
'value' => $website->getCode(),
45-
'label' => $website->getName()
45+
'label' => $website->getName(),
4646
];
4747
}
4848
return $websites;

app/code/Magento/InventorySales/Model/ReplaceSalesChannelsOnStockInterface.php renamed to app/code/Magento/InventorySales/Model/ReplaceSalesChannelsForStockInterface.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
namespace Magento\InventorySales\Model;
99

1010
/**
11-
* TODO: SPI description
11+
* Implementation of links replacement between Stock and Sales Channels (Service Provider Interface - SPI)
12+
* Provide own implementation of this interface if you would like to replace channels management strategy
1213
*
1314
* @api
1415
*/
15-
interface ReplaceSalesChannelsOnStockInterface
16+
interface ReplaceSalesChannelsForStockInterface
1617
{
1718
/**
18-
* Replace existing or non existing Sales Channels for Stock
19+
* Replace Sales Channels for Stock
1920
*
2021
* @param array $salesChannels
2122
* @param int $stockId

app/code/Magento/InventorySales/Model/ReplaceSalesChannelsOnStock.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)