-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verification of Order
might fail if it contains OrderLine
s exceeding the stock, but compensating OrderLine
s exist
#424
Comments
… sufficient stock There are a few edge cases when checking if a `UnqiueInventory` has sufficient stock for completing orders which are solved by providing tested methods for this.
Can you elaborate on the premise? Why did you implement the methods in the first place? The entire check whether sufficient stock is available to satisfy an Fundamentally, the verifications of the
To me, it feels like it might make sense to discuss these items individually as they each leave a few things to discuss and explore and trying to elaborate on them in parallel might get a bit confusing. I'd still like to hear about your immediate response before deciding how to proceed in that regard. |
Thank you for your response. Use CaseMy use case was highlighting orders in the front end which can be completed. negative QuantitiesI do have no problems with negative quantities (please dont remove them) but I noticed that completing an UII missingYou are right. |
I guess the way to go would be to use the currently existing You're right regarding the processing of the individual quantities. A single |
Order
might fail if it contains OrderLine
s exceeding the stock, but compensating OrderLines
exist
Order
might fail if it contains OrderLine
s exceeding the stock, but compensating OrderLines
existOrder
might fail if it contains OrderLine
s exceeding the stock, but compensating OrderLine
s exist
While implementing methods for checking if a
UniqueInventory
has sufficient stock for completing orders I noticed that there are a few edge cases that might be useful to solve here:Order
can have multipleOrderLine
s perProduct
-> quantities have to be addedOrder
can haveOrderLine
s with negativeQuantity
-> solved like the one aboveUniqueInventoryItem
s can be missing -> missingProduct
s are assumed to have aQuantity
of zeroI implemented two new methods on
UniqueInventory
(hasSufficientQuantity(ProductIdentifier, Quantity)
andhasSufficientQuantity(Order)
) and can create a PR if you agree with my interpretation.The text was updated successfully, but these errors were encountered: