Skip to content

feat: update stock quantity #13

Closed
diyakadakia wants to merge 1 commit intomainfrom
feat/update-stock-diya
Closed

feat: update stock quantity #13
diyakadakia wants to merge 1 commit intomainfrom
feat/update-stock-diya

Conversation

@diyakadakia
Copy link
Copy Markdown
Collaborator

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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Copy Markdown
Collaborator

@BeWelsh BeWelsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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:

  1. Add your existing tests into this PR test_create_order_reduces_stock and test_create_order_does_not_reduce_stock_on_failure
  2. 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
  3. You updated the docstring in the service layer - good catch. Do the same for the docstring in the router layer

Great job Diya!

@diyakadakia diyakadakia closed this Feb 1, 2026
@BeWelsh BeWelsh deleted the feat/update-stock-diya branch February 3, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants