feat: update stock quantity #13
Closed
diyakadakia wants to merge 1 commit intomainfrom
Closed
Conversation
BeWelsh
requested changes
Jan 20, 2026
Collaborator
BeWelsh
left a comment
There was a problem hiding this comment.
@diyakadakia Great Job! Sadly I think the test cases you added didn't make their way into this PR, but I see them in your other pull request and they look good. Your commit history is clean, GREAT comments, and your solution is clean and accurate.
One thing I want to bring up is upon opening a PR, make sure to request Jerome + myself for review. This just notifies us that there is new stuff to be merged!
Make the following changes, and request a review:
- Add your existing tests into this PR
test_create_order_reduces_stockandtest_create_order_does_not_reduce_stock_on_failure - Add one additional test that covers a specific edge case that is not currently covered (hint: what if you made an order of both your previous tests' orders combined)? If that last part didn't make sense, slack me
- You updated the docstring in the service layer - good catch. Do the same for the docstring in the router layer
Great job Diya!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What does this PR do?
The create_order() function updates the stock quantities when a valid order has been placed.
How Has This Been Tested?
In the test_examples files I created test_create_order_reduces_stock and est_create_order_does_not_reduce_stock_on_failuret to make sure the inventory is updated.
Checklist: