Shouldn't this operation be made in the product provider? You could pass the quantity instead of the stock as an argument.