-
Notifications
You must be signed in to change notification settings - Fork 248
Technical Design. Open Questions
Ievgen Shakhsuvarov edited this page Jul 16, 2019
·
8 revisions
- Synchronization of Legacy stock systems with MSI (bi-directional synchronization). Problem: In the legacy system "in_stock" field of StockItem is a partially calculatable field as it takes into account "is manage stock" configuration option, in MSI - "in_stock" field of SourceItem - not calculatable, but specified by admin. This sometimes lead for incorrect "Is In Stock" status for products. The issue is particularly described here - https://github.com/magento/inventory/wiki/%5BDRAFT%5D-Synchronization-between-legacy-inventory-data-and-MSI
- Modularity. Currently, we segregate business logic by
API
,Implementation
,AdminUi
modules. Modules containing implementation and modules containing UI should communicate to each other via API modules only. Problem: we need to introduce "sugar API" which wrap existing API. Thus, implementation of one ServiceContract refers to other services. This introduces two issues:- Replaceability. Substituting implementation of one API not guarantee that API being called in old implementation would be called by the new implementation, so there is no guarantee that plugins assigned to API would be called.
- To prevent business code from excessive logic "sugar APIs" appear. Which just wrap existing fine-grained API. Like, getFirstName / getLastName combined into getFullName for Customer object. Thus, as a result, we end up with several APIs which could be used for achieving the same business operation. More than one pluginization points.
- Remove setter methods from Entity Data interfaces in Service Contracts. After this PR would be merged https://github.com/magento/magento2/pull/14801 we would not have anymore limitation that our DTO interfaces should have setter methods (which are being utilized by webapi framework for object instantiation). Thus, our entities should such as SourceInterface, StockInterface, SourceItemInterface etc., should be updated correspondingly.
- Disable Default Source. Currently, it's possible to disable Default Source which potentially leads to unpredictable behavior both from front-end and back-end sides. We have a concept of Default Source/Stock for seamless migration of existing Magento merchants, also we re-use
cataloginventory_stock_status
table as an index for Default Stock data. Should we forbid to disable Default Source? Should we provide a possibility to build Single Source Inventory based on non-Default Source? - When all the variations of Configurable product are disabled, should we change "Stock Status" of Configurable to "Out of Stock", or just make Configurable product disabled as well?
- Should we leave legacy Inventory index or it should be fully substituted by new MSI one? If we leave both, how these indexes should be synchronized? Currently, we re-use legacy index for Default Stock because it supports of Bundle and Grouped product Inventory indexation which we use in Single Source mode.
- Should we keep the synchronization between Catalog and Inventory? For example, remove all the SourceItems and StockItems when a product is removed from Catalog. Ideally, if we are following principles of microservice architecture - not. This means that we need to have an ability to process an order (invoice, ship) if product mentioned in the given order is removed from Catalog. Issue gets more complicated, because currently MSI does not save own version of Stock Configuration data and re-use
cataloginventory_stock_item
which is deleted when a product is removed from Catalog.- Installing MSI we could remove DB constraint on cataloginventory_stock_item table
CONSTRAINT CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID
FOREIGN KEY (product_id
) REFERENCEScatalog_product_entity
(entity_id
) ON DELETE CASCADE,``
- Installing MSI we could remove DB constraint on cataloginventory_stock_item table
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