Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetListTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source-item';
const RESOURCE_PATH = '/V1/inventory/source-items';
const SERVICE_NAME = 'inventoryApiSourceItemRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class SourceItemsDeleteTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source-items';
const RESOURCE_DELETE_PATH = '/V1/inventory/source-items-delete';
const RESOURCE_PATH = '/V1/inventory/source-item';
const SERVICE_NAME = 'inventoryApiSourceItemsDeleteV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SaveTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source-item';
const RESOURCE_PATH = '/V1/inventory/source-items';
const SERVICE_NAME_SAVE = 'inventoryApiSourceItemsSaveV1';
const SERVICE_NAME_DELETE = 'inventoryApiSourceItemsDeleteV1';
/**#@-*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ValidationTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source-item';
const RESOURCE_PATH = '/V1/inventory/source-items';
const SERVICE_NAME = 'inventoryApiSourceItemsSaveV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CarrierLinkManagementTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetListTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GetTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RegionProcessingTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UpdateTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ValidationTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CreateTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DeleteTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetListTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GetTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UpdateTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ValidationTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock';
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetStockSourceLinksTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock-source-link';
const RESOURCE_PATH = '/V1/inventory/stock-source-links';
const SERVICE_NAME = 'inventoryApiGetStockSourceLinksV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class StockSourceLinksDeleteTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock-source-link';
const RESOURCE_PATH = '/V1/inventory/stock-source-links';
const RESOURCE_DELETE_PATH = '/V1/inventory/stock-source-links-delete';

const SERVICE_NAME_SAVE = 'inventoryApiStockSourceLinksSaveV1';
const SERVICE_NAME_DELETE = 'inventoryApiStockSourceLinksDeleteV1';
const SERVICE_NAME_GET_LIST = 'inventoryApiGetStockSourceLinksV1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StockSourceLinksSaveTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock-source-link';
const RESOURCE_PATH = '/V1/inventory/stock-source-links';
const SERVICE_NAME_SAVE = 'inventoryApiStockSourceLinksSaveV1';
const SERVICE_NAME_DELETE = 'inventoryApiStockSourceLinksDeleteV1';
const SERVICE_NAME_GET_LIST = 'inventoryApiGetStockSourceLinksV1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
<operation name="CreateSource" dataType="source" type="create"
auth="adminOauth" url="/V1/inventory/source" method="POST">
auth="adminOauth" url="/V1/inventory/sources" method="POST">
<contentType>application/json</contentType>
<object dataType="source" key="source">
<field key="source_code">string</field>
Expand All @@ -32,7 +32,7 @@
</object>
</operation>
<operation name="DeleteSource" dataType="source" type="delete"
auth="adminOauth" url="/V1/inventory/source/{source_code}" method="DELETE">
auth="adminOauth" url="/V1/inventory/sources/{source_code}" method="DELETE">
<contentType>application/json</contentType>
</operation>
</operations>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
<operation name="CreateStock" dataType="stock" type="create"
auth="adminOauth" url="/V1/inventory/stock" method="POST">
auth="adminOauth" url="/V1/inventory/stocks" method="POST">
<contentType>application/json</contentType>
<object dataType="stock" key="stock">
<field key="stock_id">integer</field>
Expand All @@ -25,7 +25,7 @@
</object>
</operation>
<operation name="DeleteStock" dataType="stock" type="delete"
auth="adminOauth" url="/V1/inventory/stock/{return}" method="DELETE">
auth="adminOauth" url="/V1/inventory/stocks/{return}" method="DELETE">
<contentType>application/json</contentType>
</operation>
</operations>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
<operation name="LinksSourceStock" dataType="source-stock-links" type="create" auth="adminOauth" url="/V1/inventory/stock-source-link" method="POST">
<operation name="LinksSourceStock" dataType="source-stock-links" type="create" auth="adminOauth" url="/V1/inventory/stock-source-links" method="POST">
<contentType>application/json</contentType>
<array key="links">
<value>source-stock-link</value>
Expand Down
28 changes: 14 additions & 14 deletions app/code/Magento/InventoryApi/etc/webapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<!-- Source -->
<route url="/V1/inventory/source" method="GET">
<route url="/V1/inventory/sources" method="GET">
<service class="Magento\InventoryApi\Api\SourceRepositoryInterface" method="getList"/>
<resources>
<resource ref="Magento_InventoryApi::source"/>
</resources>
</route>
<route url="/V1/inventory/source/:sourceCode" method="GET">
<route url="/V1/inventory/sources/:sourceCode" method="GET">
<service class="Magento\InventoryApi\Api\SourceRepositoryInterface" method="get"/>
<resources>
<resource ref="Magento_InventoryApi::source"/>
</resources>
</route>
<route url="/V1/inventory/source" method="POST">
<route url="/V1/inventory/sources" method="POST">
<service class="Magento\InventoryApi\Api\SourceRepositoryInterface" method="save"/>
<resources>
<resource ref="Magento_InventoryApi::source_edit"/>
</resources>
</route>
<route url="/V1/inventory/source/:sourceCode" method="PUT">
<route url="/V1/inventory/sources/:sourceCode" method="PUT">
<service class="Magento\InventoryApi\Api\SourceRepositoryInterface" method="save"/>
<resources>
<resource ref="Magento_InventoryApi::source_edit"/>
Expand All @@ -39,50 +39,50 @@
</resources>
</route>
<!-- Stock -->
<route url="/V1/inventory/stock" method="GET">
<route url="/V1/inventory/stocks" method="GET">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="getList"/>
<resources>
<resource ref="Magento_InventoryApi::stock"/>
</resources>
</route>
<route url="/V1/inventory/stock/:stockId" method="GET">
<route url="/V1/inventory/stocks/:stockId" method="GET">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="get"/>
<resources>
<resource ref="Magento_InventoryApi::stock"/>
</resources>
</route>
<route url="/V1/inventory/stock" method="POST">
<route url="/V1/inventory/stocks" method="POST">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="save"/>
<resources>
<resource ref="Magento_InventoryApi::stock_edit"/>
</resources>
</route>
<route url="/V1/inventory/stock/:stockId" method="DELETE">
<route url="/V1/inventory/stocks/:stockId" method="DELETE">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="deleteById"/>
<resources>
<resource ref="Magento_InventoryApi::stock_delete"/>
</resources>
</route>
<route url="/V1/inventory/stock/:stockId" method="PUT">
<route url="/V1/inventory/stocks/:stockId" method="PUT">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="save"/>
<resources>
<resource ref="Magento_InventoryApi::stock_edit"/>
</resources>
</route>
<route url="/V1/inventory/stock/:stockId" method="DELETE">
<route url="/V1/inventory/stocks/:stockId" method="DELETE">
<service class="Magento\InventoryApi\Api\StockRepositoryInterface" method="deleteById"/>
<resources>
<resource ref="Magento_InventoryApi::stock_delete"/>
</resources>
</route>
<!-- StockSourceLink -->
<route url="/V1/inventory/stock-source-link" method="GET">
<route url="/V1/inventory/stock-source-links" method="GET">
<service class="Magento\InventoryApi\Api\GetStockSourceLinksInterface" method="execute"/>
<resources>
<resource ref="Magento_InventoryApi::stock_source_link"/>
</resources>
</route>
<route url="/V1/inventory/stock-source-link" method="POST">
<route url="/V1/inventory/stock-source-links" method="POST">
<service class="Magento\InventoryApi\Api\StockSourceLinksSaveInterface" method="execute"/>
<resources>
<resource ref="Magento_InventoryApi::stock_source_link"/>
Expand All @@ -95,13 +95,13 @@
</resources>
</route>
<!-- SourceItem -->
<route url="/V1/inventory/source-item" method="GET">
<route url="/V1/inventory/source-items" method="GET">
<service class="Magento\InventoryApi\Api\SourceItemRepositoryInterface" method="getList"/>
<resources>
<resource ref="Magento_InventoryApi::source"/>
</resources>
</route>
<route url="/V1/inventory/source-item" method="POST">
<route url="/V1/inventory/source-items" method="POST">
<service class="Magento\InventoryApi\Api\SourceItemsSaveInterface" method="execute"/>
<resources>
<resource ref="Magento_InventoryApi::source"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testGetDefaultSource()
$defaultSourceCode = $this->defaultSourceProvider->getCode();
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/inventory/source/' . $defaultSourceCode,
'resourcePath' => '/V1/inventory/sources/' . $defaultSourceCode,
'httpMethod' => Request::HTTP_METHOD_GET,
],
'soap' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testGetDefaultSource()
$defaultStockId = $this->defaultStockProvider->getId();
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/inventory/stock/' . $defaultStockId,
'resourcePath' => '/V1/inventory/stocks/' . $defaultStockId,
'httpMethod' => Request::HTTP_METHOD_GET,
],
'soap' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testCouldNotDeleteException()
{
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/inventory/stock/' . $this->defaultStockProvider->getId(),
'resourcePath' => '/V1/inventory/stocks/' . $this->defaultStockProvider->getId(),
'httpMethod' => Request::HTTP_METHOD_DELETE,
],
'soap' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PreventAssignSourcesToDefaultStockTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH_ASSIGN_SOURCES_TO_STOCK = '/V1/inventory/stock-source-link';
const RESOURCE_PATH_ASSIGN_SOURCES_TO_STOCK = '/V1/inventory/stock-source-links';
const SERVICE_NAME_ASSIGN_SOURCES_TO_STOCK = 'inventoryApiStockSourceLinksSaveV1';
/**#@-*/

Expand Down Expand Up @@ -102,10 +102,6 @@ public function dataProviderWrongParameters(): array
'message' => 'Can not save link related to Default Source or Default Stock',
'parameters' => [],
],
[
'message' => 'Can not save link related to Default Source or Default Stock',
'parameters' => [],
],
],
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PreventDefaultSourceDisablingTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/source';
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testCouldNotDeleteException()
$stockId = 10;
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/inventory/stock/' . $stockId,
'resourcePath' => '/V1/inventory/stocks/' . $stockId,
'httpMethod' => Request::HTTP_METHOD_DELETE,
],
'soap' => [
Expand Down
Loading