Skip to content

Fix hard dependency of InventoryCatalog on Inventory module #1151

Closed
@maghamed

Description

@maghamed

Currently, we have a hard dependency of module InventoryCatalog on Inventory because of

class \Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave

We use this class implementation to prevent repetitive synchronization of Legacy-MSI-Legacy update. To make this happen we add new implementation (along with one we have in Inventory Module) and disable Plugin on it

    <type name="Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave">
        <plugin name="set_data_to_legacy_catalog_inventory_at_source_items_save" disabled="true"/>
    </type>

what we need to do is:

  • move class \Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave under the same namespace where \Magento\Inventory\Model\SourceItem\Command\SourceItemsSave stored
  • rename SourceItemsSave -> SourceItemsSaveWithoutLegacySynchronization
  • to prevent copy-pasting and making both class to have the same logic - introduce proxy
  • inject this proxy in both of these classes SourceItemsSaveWithoutLegacySynchronization and SourceItemsSave and proxy method execute on the newly created class

after that change dependency of InventoryCatalog to Inventory as "soft" one

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions