Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement API endpoint to fetch products belonging to a specific vendor #156

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

wayneleon1
Copy link
Contributor

@wayneleon1 wayneleon1 commented Jul 19, 2024

Description

This PR implements functionality to allow vendors to retrieve their own products on the backend side of the application. Vendors can now view a list of their products, including all relevant details.

Requirements Implemented

  1. Endpoint Creation:

    • Created a new API endpoint to fetch products belonging to a specific vendor.
  2. Authentication & Authorization:

    • Ensured that the vendor is authenticated before they can access their products.
    • Implemented authorization to ensure that a vendor can only access their own products and not those of other vendors.
  3. Database Query:

    • Wrote a query to fetch products from the database that belong to the authenticated vendor.

Acceptance Criteria

  • An authenticated vendor can successfully retrieve a list of their own products via the new API endpoint.
  • The response includes all required product details in a structured JSON format.
  • Appropriate error handling is in place for various failure scenarios.
  • Unit tests are written to cover the new functionality.

Additional Notes

  • Code follows existing code standards and practices.
  • Documentation for the new API endpoint is provided, including request and response examples.
  • Collaboration with the frontend team ensured they have the necessary information to integrate this new functionality.

Screenshots

Screenshot 2024-07-19 at 12 16 21

Testing

  • Unit tests have been written and successfully run to cover the new functionality.

Related Issues

#155

@wayneleon1 wayneleon1 linked an issue Jul 19, 2024 that may be closed by this pull request
4 tasks
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.41%. Comparing base (2a1f852) to head (1e27ca9).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #156      +/-   ##
===========================================
+ Coverage    86.37%   86.41%   +0.03%     
===========================================
  Files           65       65              
  Lines         1754     1759       +5     
  Branches       193      193              
===========================================
+ Hits          1515     1520       +5     
  Misses         212      212              
  Partials        27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wayneleon1 wayneleon1 self-assigned this Jul 19, 2024
@wayneleon1 wayneleon1 added backend Good for newcomers Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager labels Jul 19, 2024
Copy link
Contributor

@ambroisegithub ambroisegithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looks good for merge!!!

@dushimeemma dushimeemma merged commit 6121d7f into develop Jul 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Good for newcomers Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Vendor should be able to get own products
5 participants