Skip to content

New Indexer for StockItems

Igor Miniailo edited this page Aug 3, 2017 · 4 revisions

What we need to index

Building new Inventory implementation which supports multi source/stock capabilities. We need to calculate the stock quantities for SKUs per each particular Sales Channel (website or store). For these purposes, we have StockItem entity which represents an Aggregated Virtual Stock. Which is used as Read-only data generated in a result of the re-indexation process based on pre-defined mapping which defines a binding between Stock objects and Sources assigned to them (SourceStockLink on the diagram above).

For example, there are 3 physical sources (A, B and C) which assigned to specific sales channel (for example, Magento Website). If Customer comes to this website and wants to buy some product (Product1), we should show him that we have next amount of this product: Qty of Product1 on A + Qty of Product1 on B + Qty of Product1 on C This is what StockItem does.

Read more about this in MSI Technical Vision document.

As rules (SourceStockLink) we use for StockItems creation are added dynamically and could be changed anytime. It's convenient to introduce dedicated index which would store StockItem data. Doing so we offload our front-end as we no need to calculate aggregations dynamically at a time of users' request. All the aggregations would be pre-calculated in advance and we need just to refer these data to use. So that we would not affect performance adding multiple sources functionality.

MSI Documentation:

  1. Technical Vision. Catalog Inventory
  2. Installation Guide
  3. List of Inventory APIs and their legacy analogs
  4. MSI Roadmap
  5. Known Issues in Order Lifecycle
  6. MSI User Guide
  7. DevDocs Documentation
  8. User Stories
  9. User Scenarios:
  10. Technical Designs:
  11. Admin UI
  12. MFTF Extension Tests
  13. Weekly MSI Demos
  14. Tutorials

Clone this wiki locally