Skip to content

Sources to Sales Channels Mapping

Igor Miniailo edited this page Jun 26, 2017 · 25 revisions

Table of Contents

Description

Merchant should have an ability to map existing physical sources to some particular sales channels. The most appropriate sales channel example in Magento is Website. But that's not the only option, for example, for B2B merchants Customer Group could be considered a sales channel, or Country/State etc. Thus we need to provide an ability on the level of API to implement this kind of mapping.

Omni channel

Diagram of relationship

Interfaces Draft

/**
 * Aggregated Stock
 * Stock would be used on Front-End to show final Stock Quantity
 **/
interface Stock
{
    public function getStockId();

    public function getStockName();
}


/**
 * Aggregation of physical sources and creation of virtual stock 
 * based on this aggregation
 **/
interface SourceStockLink
{
    public function getStockId();

    public function getSourceId();
}



/**
 * Representation of Sales Channel a.k.a Website or CustomerGroup 
 **/
interface SalesChannel 
{
    public function getEntityId(); // Surrogate key

    public function getSalesChannelId(); // represents concrete Sales Channel Id, for example, website_id - 1

    public function getType(); // "WEBSITE" | "COUNTRY" | "CUSTOMER_GROUP"
}


/**
 * Interface to assign specific stock to particular sales channel
 **/
interface StockSalesChannelLink
{
    public function getStockId();

    public function getSalesChannelEntityId(); // there should not be more than ONE sales channel with particular ID value 
}

Single Stock Example

interface Stock
{
    public function getStockId();   // 1

    public function getStockName(); // "Single Stock"
}

interface SourceStockLink
{
    public function getStockId();  // 1

    public function getSourceId(); // 1
}

interface SalesChannel 
{
    public function getEntityId();       // 1

    public function getSalesChannelId(); // website_id - 1

    public function getType();           // "WEBSITE" 
}

interface StockSalesChannelLink
{
    public function getStockId();              // 1

    public function getSalesChannelEntityId(); // 1 
}

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