Msi stock ui aggregation#35
Conversation
- created Resource models, models and APIs
- created StockRepositoryInterface and StockRepository
- created Stock UI files and view ui layout and component for adminhtml Merge branch 'msi-stock-ui-aggregation' of https://github.com/jonfres/magento2 into msi-stock-ui-aggregation
…/magento2 into msi-stock-ui-aggregation
- created test for StockRepository
- controller Stock and menu option for Manage Stock added
…/magento2 into msi-stock-ui-aggregation
…/magento2 into msi-stock-ui-aggregation
- controller Stock and menu option for Manage Stock added2
- changed implementation of StockRepository
…/magento2 into msi-stock-ui-aggregation # Conflicts: # app/code/Magento/Inventory/Ui/DataProvider/StockDataProvider.php
- fixes for the grid on Stock listing
…/magento2 into msi-stock-ui-aggregation
| use Magento\InventoryApi\Api\Data\StockInterface; | ||
|
|
||
| /** | ||
| * Class Edit |
| use Magento\Framework\Controller\ResultFactory; | ||
|
|
||
| /** | ||
| * Class Index |
| use Magento\InventoryApi\Api\StockRepositoryInterface; | ||
|
|
||
| /** | ||
| * Class Save |
| } | ||
|
|
||
| /** | ||
| * {@inheritdoc} |
| $requestData = $this->getRequest()->getParam('general'); | ||
| if ($this->getRequest()->isPost() && $requestData) { | ||
| try { | ||
| $stockId = !empty($requestData[StockInterface::STOCK_ID]) |
There was a problem hiding this comment.
non-readable negative short if improve this for better readable code
| } | ||
|
|
||
| /** | ||
| * @param int $stockId |
There was a problem hiding this comment.
add some function description
| </editor> | ||
| </settings> | ||
| </column> | ||
| <!--<column name="contact_name" sortOrder="40"> |
| $connection, | ||
| $resource | ||
| ); | ||
| } |
There was a problem hiding this comment.
why do we need constructor, if all the parameters are just proxying to parent constructor
| use Magento\InventoryApi\Api\Data\StockInterface; | ||
|
|
||
| /** | ||
| * Class Source |
There was a problem hiding this comment.
please provide more meaningful description
| @@ -0,0 +1,134 @@ | |||
| <?php | |||
| /** | |||
| * Copyright © Magento, Inc. All rights reserved. | |||
There was a problem hiding this comment.
we need to have delete()
operation in Stock repository.
When Stock is removed, we need to remove all stock items related to it (could be done using Foreign Key on DB level)
| use Magento\Framework\Api\ExtensibleDataInterface; | ||
|
|
||
| /** | ||
| * SourceCarrierLink interface |
There was a problem hiding this comment.
we need to provide more meaningful description to this interface.
| * SourceCarrierLink interface | ||
| * @api | ||
| */ | ||
| interface SourceStockLinkInterface extends ExtensibleDataInterface |
There was a problem hiding this comment.
there is no class which implements this interface
| * @param string $name | ||
| * @return void | ||
| */ | ||
| public function setName($name); |
There was a problem hiding this comment.
need to specify
getExtensionAttributes/setExtensionAttributes methods and specify own types they accept
| use Magento\Framework\Api\SearchResultsInterface; | ||
|
|
||
| /** | ||
| * @api |
There was a problem hiding this comment.
please add description to all interfaces marked as api
| namespace Magento\InventoryApi\Api; | ||
|
|
||
| /** | ||
| * @api |
There was a problem hiding this comment.
meaningful description should be added
| */ | ||
| public function getList( | ||
| \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null | ||
| ); |
There was a problem hiding this comment.
need to add deleteById method to the interface
| * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria | ||
| * @return \Magento\InventoryApi\Api\Data\StockSearchResultsInterface | ||
| */ | ||
| public function getList( |
There was a problem hiding this comment.
we have the only field (Name) by which we could make filtering, don't think that we need to over complicate our API and accept SearchCriteria in this case.
$name parameter should be okay
Description
Contribution checklist