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
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