innoshop icon indicating copy to clipboard operation
innoshop copied to clipboard

Prevent excessive product return requests

Open dinmezpinar opened this issue 7 months ago • 1 comments

Customers were previously able to request returns for a quantity greater than what they originally ordered. This commit adds a validation check to ensure that the total return quantity, including previous returns, does not exceed the ordered amount for the given product. If the condition is violated, the user is shown an appropriate error message.

dinmezpinar avatar May 09 '25 20:05 dinmezpinar

@dinmezpinar Thanks for your PR. I think the detection code would be better placed in OrderReturnRepo. This way, the controller remains lightweight, and the logic is centralized in the repository, making it reusable for REST APIs as well. What do you think?

yushine avatar May 11 '25 00:05 yushine