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
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.
Response (200 OK): [ { "id": 1, "name": "Product A", "price": 150 }, { "id": 2, "name": "Product B", "price": 300 } ]