SaaS CMS has officially launched! Learn more now.

Custom IInventoryService implementation


I am faced with the task of changing the management of stock, the actual source of the data from which we want to get information on how much product is available is going to be our separate database in Azure, it is the only place where we are supposed to take information about the quantity of products. 

I am wondering how to approach this task, will my own implementation of the IInventoryService interface be sufficient here, in which I will make a request to Azure instead of querying the EpiCommerce tables?

Mar 07, 2023 13:06

Yes it should. 

Mar 07, 2023 14:32

It is possible to make and register your own implementation of IInventoryService. But:

  • Be aware that its method may be called many times. So consider the impact and maybe apply some caching in strategic places.
  • Consider whether you will be implementing the insert/update/delete methods, since they can be used from the Catalog UI.
  • Consider whether you will be adjusting the inventory in the external stock database. This is used a lot by InventoryRequester and IInventoryProcessor.AdjustInventoryOrRemoveLineItem.
Mar 13, 2023 19:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.