-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When a customer places an order for a product with a quantity greater than the available stock, the order is accepted and confirmed. The system does not validate stock levels at the time of order placement, leading to overselling.
Steps to Reproduce
Set a product's stock to 2 units
Place an order for 5 units of that product
Observe: order is confirmed with status "Accepted"
Expected Behaviour
The order should be rejected with an appropriate error message when the requested quantity exceeds available stock.
Acceptance Criteria
Scenario: Place order with sufficient stock
Given a product with 10 units in stock
When a customer places an order for 3 units
Then the order should be accepted
Scenario: Place order with insufficient stock
Given a product with 2 units in stock
When a customer places an order for 5 units
Then the order should be rejected
And the error should indicate insufficient stock
Scenario: Place order for exact available quantity
Given a product with 3 units in stock
When a customer places an order for 3 units
Then the order should be accepted
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done