Skip to content
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: Update old StockItem and Stock Status DB table at the time of Reservation appended #170

Merged
merged 13 commits into from
Nov 22, 2017

Conversation

larsroettig
Copy link
Member

@larsroettig larsroettig commented Oct 29, 2017

Currently, Work in Progress see #167

- Add arround plugin listen to reservations append function
@larsroettig larsroettig self-assigned this Oct 29, 2017
@larsroettig larsroettig added this to the MSI Part I milestone Oct 29, 2017
@larsroettig larsroettig changed the title WIP MSI: #167 MSI: Update old StockItem and Stock Status DB table at the time of Reservation appended - #167 Oct 29, 2017
@larsroettig larsroettig changed the title MSI: Update old StockItem and Stock Status DB table at the time of Reservation appended - #167 MSI: Update old StockItem and Stock Status DB table at the time of Reservation appended Oct 29, 2017
@sinisa86 sinisa86 self-assigned this Nov 18, 2017
@maghamed
Copy link
Contributor

maghamed commented Nov 21, 2017

Hey, @sinisa86 could you please merge latest develop branch into msi-add-reservation-to-stockItem-table and run tests again.

Looks like there could be issues after latest develop merged.

Just merged develop by myself and run tests. Will see results soon

$oldStockItem = current($collectionAfterChange->getItems());
$quantityAfterCheck = $oldStockItem->getQty();

$this->assertEquals($this->getProductQtyInStock->execute('SKU-1', 10), $quantityAfterCheck);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, you need to add one more assert that both these value equal to 8.5 - 5
because your case will work even if Reservation did not affect both of the Inventory data and they stayed the same

/**
* @var \Magento\CatalogInventory\Api\StockRegistryInterface
*/
protected $stockRegistry;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stockRegistry should be private

*/

/** @var $product \Magento\Catalog\Model\Product */
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, none of the test classes use this fixture.
As you adapted products_simple.php for your purposes
Do we really need it?

use Magento\CatalogInventory\Api\StockRegistryInterface;

/**
* Plugin help to fill the legacy catalog inventory tables cataloginventory_stock_status and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helpS


/**
* Plugin help to fill the legacy catalog inventory tables cataloginventory_stock_status and
* cataloginventory_stock_item to don't break the backward compatible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to don't break the backward compatible. ->
to prevent breaking the backward compatibility

@maghamed maghamed merged commit 36f759e into develop Nov 22, 2017
@maghamed maghamed deleted the msi-add-reservation-to-stockItem-table branch December 11, 2018 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants