-
Notifications
You must be signed in to change notification settings - Fork 248
Technical Vision. Catalog Inventory
Multi Source Inventory (MSI) is developing for Magento Open Source. MSI is an evolution of original CatalogInventory module and interfaces.
We consider two main entities of stock:
- Source stock, the stock that is physically in a source
- Aggregate stock, the virtual stock of what can be sold in a sales channel
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 We call it – Virtual Aggregated Stock (StockItem in Magento words).
There are two important considerations for stock handling:
- Aggregation (StockItem), aggregating the stock of several sources
- Multiple sales channels can use the same aggregate (DE & NL share the same stock)
How it looks like on the code level. On the code level we have next entities:
- Source – definition of physical stock (brick and mortar store, source, warehouse etc.)
- SourceItem – relation object, which represents the amount of specific product on the particular physical source. We use this entity for updating inventory on each particular source. (sync with PIM or ERP system, or stock deduction during the checkout process). Can’t be used for retrieving data which need to be rendered on front-end, because only aggregated data should be used for all validations and UI representation.
- StockItem – Aggregated Virtual Stock. Read-only data which were generated as a result of re-indexation process. Where based on pre-defined mapping we define what sources are assigned to current scope (sales channel), and aggregates quantities from all these sources. Also we use StockItem to check whether specific Product is in Stock or Out of Stock. Making this segregation by Read-Only interface (StockItem) and Write-Only interface (SourceItem) we achieve CQRS on the level of Inventory architecture. Roughly saying, all the GET HTTP requests should use StockItem entity, all the POST/PUT should use SourceItem.
When Customer buys the product, it should be shipped from the particular location. A customer usually does not care what location product was shipped from, as soon as this is the cheapest option. For the Merchant, it is important to have minimal overhead for the inventory storage and shipping costs. An algorithm which assigns the particular inventory to the order item should take all these considerations into account and select the best possible options. Our current idea is to provide two out of the box algorithms:
- Priority based algorithm (where each source given a priority in the scope of specific sales channel)
- Minimal delivery cost algorithm
On the level of API we should provide an ability to support both Synchronous as well as Asynchronous calculation during the checkout process. You can read here more about our insight and requirements for Algorithm API and implementation
Multi-Source Inventory developed by Magento 2 Community
- Technical Vision. Catalog Inventory
- Installation Guide
- List of Inventory APIs and their legacy analogs
- MSI Roadmap
- Known Issues in Order Lifecycle
- MSI User Guide
- 2.3 LIVE User Guide
- MSI Release Notes and Installation
- Overview
- Get Started with MSI
- MSI features and processes
- Global and Product Settings
- Configure Source Selection Algorithm
- Create Sources
- Create Stock
- Assign Inventory and Product Notifications
- Configure MSI backorders
- MSI Import and Export Product Data
- Mass Action Tool
- Shipment and Order Management
- CLI reference
- Reports and MSI
- MSI FAQs
- DevDocs Documentation
- Manage Inventory Management Modules (install/upgrade info)
- Inventory Management
- Reservations
- Inventory CLI reference
- Inventory API reference
- Inventory In-Store Pickup API reference
- Order Processing with Inventory Management
- Managing sources
- Managing stocks
- Link and unlink stocks and sources
- Manage source items
- Perform bulk actions
- Manage Low-Quantity Notifications
- Check salable quantities
- Manage source selection algorithms
- User Stories
- Support of Store Pickup for MSI
- Product list assignment per Source
- Source assignment per Product
- Stocks to Sales Channel Mapping
- Adapt Product Import/Export to support multi Sourcing
- Introduce SourceCode attribute for Source and SourceItem entities
- Assign Source Selector for Processing of Returns Credit Memo
- User Scenarios:
- Technical Designs:
- Module Structure in MSI
- When should an interface go into the Model directory and when should it go in the Api directory?
- Source and Stock Item configuration Design and DB structure
- Stock and Source Configuration design
- Open Technical Questions
- Inconsistent saving of Stock Data
- Source API
- Source WebAPI
- Sources to Sales Channels mapping
- Service Contracts MSI
- Salable Quantity Calculation and Mechanism of Reservations
- StockItem indexation
- Web API and How To cover them with Functional Testing
- Source Selection Algorithms
- Validation of Domain Entities
- PHP 7 Syntax usage for Magento contribution
- The first step towards pre generated IDs. And how this will improve your Integration tests
- The Concept of Default Source and Domain Driven Design
- Extension Point of Product Import/Export
- Source Selection Algorithm
- SourceItem Entity Extension
- Design Document for changing SerializerInterface
- Stock Management for Order Cancelation
- Admin UI
- MFTF Extension Tests
- Weekly MSI Demos
- Tutorials