hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
154 stars 136 forks source link

[FEAT]: Retrieve Product Details #83

Open theijhay opened 2 months ago

theijhay commented 2 months ago

Description:

Develop a backend API endpoint to allow logged-in users to retrieve the details of a specific product. This functionality is part of the product management system and requires user authentication.

Acceptance Criteria:

Endpoint security:

Only authenticated users can have access to the endpoint A user must have the appropriate permissions to access the endpoint Each request to the endpoint must include a valid authentication token in the

1. Retrieve Product Details:

Purpose: To provide a secure and authenticated endpoint for retrieving details of a specific product, ensuring only authorized users can access this information.

Expected Outcome: A fully functional backend API endpoint that allows logged-in users to retrieve product details, with proper validation and error handling.

Tasks:

Test Scenarios:

  1. Successful product retrieval: Verify that a logged-in user can retrieve product details with a valid product ID.
  2. Product not found: Verify that the endpoint returns a 404 status code when the product does not exist.
  3. Unauthorized access: Verify that the endpoint returns a 401 status code when the user is not authorized to view the product.
  4. Validation error: Verify that the endpoint returns a 400 status code when required parameters are missing or incorrectly formatted.
theijhay commented 2 months ago

@Laban254 You did not assign me

Laban254 commented 2 months ago

@theijhay Done

JoshuaOloton commented 2 months ago

This is a duplicate of #62

theijhay commented 2 months ago

Don't forget that @zxenonx has checked this already. you can contact him @JoshuaOloton