From 4c951e1ec23c38851cd646522da8c2d3db14764e Mon Sep 17 00:00:00 2001 From: Leonid Poluianov Date: Mon, 18 Oct 2021 17:44:10 -0500 Subject: [PATCH] MDEE-46: Prepare queries to get stock item status data from Magento --- .../Model/Provider/StockStatus.php | 14 +++--- InventoryDataExporter/etc/mview.xml | 2 +- InventoryDataExporter/etc/query.xml | 48 ++++++++++++++++--- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/InventoryDataExporter/Model/Provider/StockStatus.php b/InventoryDataExporter/Model/Provider/StockStatus.php index b47cae96..15977fd3 100644 --- a/InventoryDataExporter/Model/Provider/StockStatus.php +++ b/InventoryDataExporter/Model/Provider/StockStatus.php @@ -56,18 +56,18 @@ public function get(array $values): array { $queryArguments = $this->data; foreach ($values as $value) { - $queryArguments['itemIds'][] = $value['id']; + $queryArguments['sourceItemIds'][] = $value['id']; } $output = []; $cursor = $this->queryProcessor->execute($this->queryName, $queryArguments); while ($row = $cursor->fetch()) { //TODO: extend query and remove this hardcode - $row['sku'] = "TestSku"; - $row['qty'] = "10"; - $row['qtyForSale'] = "4.5"; - $row['infiniteStock'] = false; - $row['lowStock'] = true; - $row['updatedAt'] = "2021-07-22 17:38:36"; +// $row['sku'] = "TestSku"; +// $row['qty'] = "10"; +// $row['qtyForSale'] = "4.5"; +// $row['infiniteStock'] = false; +// $row['lowStock'] = true; +// $row['updatedAt'] = "2021-07-22 17:38:36"; $output[] = $row; } return $output; diff --git a/InventoryDataExporter/etc/mview.xml b/InventoryDataExporter/etc/mview.xml index 487ac4b3..f4df9122 100644 --- a/InventoryDataExporter/etc/mview.xml +++ b/InventoryDataExporter/etc/mview.xml @@ -8,7 +8,7 @@ - +
diff --git a/InventoryDataExporter/etc/query.xml b/InventoryDataExporter/etc/query.xml index 06de3742..f21ae574 100644 --- a/InventoryDataExporter/etc/query.xml +++ b/InventoryDataExporter/etc/query.xml @@ -7,14 +7,50 @@ --> - - - - - + + + + + - itemIds + sourceItemIds + + + + source_code + + + + + + source_code + + + sku + + + + + + sku + + + + + + catalog_product_entity.entity_id + + + + + + sku + + + inventory_source_stock_link.stock_id + + \ No newline at end of file