Skip to content

Prevent Default Source/Stock to be deleted #120

@maghamed

Description

@maghamed

Deletion of source/stock is done by Inventory module (Source/StockRespository::delete)
but the concept that default entities could not be removed - introduced by InventoryCatalog module
thus we need to provide Before Plugin on Stock/SourceRepository::delete in InventoryCatalog.

and check whether provided ID is default one
and if so - throw an Exception
Magento\Framework\Exception\CouldNotDeleteException
to keep data consistent

Read This Design for more details - https://github.com/magento-engcom/msi/wiki/The-Concept-of-Default-Source-and-Domain-Driven-Design

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions