CSCI-GA-2820-FA24-003 / products

NYU DevOps Products Service Fall 2024
Apache License 2.0
0 stars 1 forks source link

Add Filtering by Price Range to List/Read Products API #14

Open niveditashankaranarayanan opened 4 weeks ago

niveditashankaranarayanan commented 4 weeks ago

As a user, I want to filter products by a price range, so that I can find products that fit my budget.

Details and Assumptions: Implement price range filtering in the GET /products API by using minPrice and maxPrice query parameters. This will allow users to filter products that fall within a specified price range.

Acceptance Criteria:
The API returns products where the price is between the minPrice and maxPrice query parameters (inclusive).
If no products fall within the specified price range, the API returns a 404 error.
Both minPrice and maxPrice are optional parameters. If only one is provided, filter based on that boundary.
The filter should work with other query parameters, if present (e.g., product name search).

**Example:**
Request:
GET /products?minPrice=100&maxPrice=500

Response (200 OK): [ { "id": 1, "name": "Product A", "price": 150 }, { "id": 2, "name": "Product B", "price": 300 } ]

niveditashankaranarayanan commented 3 weeks ago

Filtering could be done in subsequent sprints. Moved the other filter story to Icebox as it was a duplicate.