Skip to content

[ARCHIVED] Order placement succeeds when product is out of stock #3

@valentinajemuovic

Description

@valentinajemuovic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions