-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msi stock ui aggregation #35
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove class comment
use Magento\Framework\Controller\ResultFactory; | ||
|
||
/** | ||
* Class Index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove class comment
use Magento\InventoryApi\Api\StockRepositoryInterface; | ||
|
||
/** | ||
* Class Save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove class comment
} | ||
|
||
/** | ||
* {@inheritdoc} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use pls @inheritdoc without {}
$requestData = $this->getRequest()->getParam('general'); | ||
if ($this->getRequest()->isPost() && $requestData) { | ||
try { | ||
$stockId = !empty($requestData[StockInterface::STOCK_ID]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-readable negative short if improve this for better readable code
} | ||
|
||
/** | ||
* @param int $stockId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some function description
</editor> | ||
</settings> | ||
</column> | ||
<!--<column name="contact_name" sortOrder="40"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment code pls remove
$connection, | ||
$resource | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please provide more meaningful description
@@ -0,0 +1,134 @@ | |||
<?php | |||
/** | |||
* Copyright © Magento, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to provide more meaningful description to this interface.
* SourceCarrierLink interface | ||
* @api | ||
*/ | ||
interface SourceStockLinkInterface extends ExtensibleDataInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no class which implements this interface
* @param string $name | ||
* @return void | ||
*/ | ||
public function setName($name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add description to all interfaces marked as api
namespace Magento\InventoryApi\Api; | ||
|
||
/** | ||
* @api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meaningful description should be added
*/ | ||
public function getList( | ||
\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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