Пример #1
0
        public void RemoveFromInventory(int locationId, int productId, int quantity)
        {
            Inventory currentInventory = repo.GetProductByLocationAndProductId(locationId, productId);

            if (quantity > currentInventory.Quantity)
            {
                Log.Error($"Not Enough Product. User Requested Amount: {quantity}, Available Amount: {currentInventory.Quantity}");
                throw new Exception("\nNot Enough Product in Inventory");
            }
            repo.RemoveFromInventory(locationId, productId, quantity);
        }