-
Notifications
You must be signed in to change notification settings - Fork 0
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
buyer be able to view available products #64
Closed
niyibi250
wants to merge
37
commits into
develop
from
57-feat-buyer-should-be-able-to-list-products-from-vendors
Closed
buyer be able to view available products #64
niyibi250
wants to merge
37
commits into
develop
from
57-feat-buyer-should-be-able-to-list-products-from-vendors
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-return the product that is available -make filter the product based on availblity -return number of product based on pagination number of page and limit Feat: Buyer should be able to list products from vendors #57
-filter product based on availablity -return number of product based on specified limit and number of page Feat: Buyer should be able to list products from vendors #57
-am testing status code -type of content-type if json -status to be success #57
3 tasks
Feat: Buyer should be able to list products from vendors #57
This PR add the product swagger docs and some test category
Fixing the errors on the doumentation
…formation create endpoints for category and also database schema fix routes for products & categories implement CRUD operations for category entity create swagger docs for category routes adds delete documentation for category routes complete documentation for category routes implementing craate new product route and its controller implementing get product route and its controller working on update function Extend API endpoints store reference ID of vendor ft-Product-Docs This PR add the product swagger docs and some test category bug-documentation-fixes Fixing the errors on the doumentation store reference ID of vendor replacing try & catch with errorHandler middleware
add category testing cases
…a/dynamites-ecomm-be into ft-manage-product-#37
-filter product based on availablity -return number of product based on specified limit and number of page Feat: Buyer should be able to list products from vendors #57
-am testing status code -type of content-type if json -status to be success #57
Feat: Buyer should be able to list products from vendors #57
…ors' of https://github.com/atlp-rwanda/dynamites-ecomm-be into 57-feat-buyer-should-be-able-to-list-products-from-vendors
niyibi250
deleted the
57-feat-buyer-should-be-able-to-list-products-from-vendors
branch
May 16, 2024 16:25
3 tasks
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This pull request implements the AvailableProducts function, which retrieves available products from the database with pagination support. The function allows clients to request available products with optional pagination parameters (limit and page). If pagination parameters are not provided, default values are used (
limit=10, page=1
).Description
This function should execute a database query to fetch available products where the
isAvailable
field is set totrue.
Pagination should be applied to limit the number of products returned per page and to skip the appropriate number of records based on the page number.
The function should include the category relation to eagerly load associated categories for each product.
Handling pagination:
If pagination parameters (
limit
andpage
) are not provided in the query, default values should be used (limit=10
,page=1
).Once the products are fetched, the function should construct a JSON response containing the retrieved products, total pages, and the current page.
Total pages should be calculated based on the total count of available products and the specified limit.
The function should include appropriate error handling to handle any errors that may occur during the execution of the function (e.g., database query error, server error).
If an error occurs, the function should return a 500 status code along with an error message.
Test the AvailableProducts route to ensure it retrieves available products correctly with the expected pagination behavior.
Verify that error handling is working as expected and that appropriate responses are returned in case of errors.
Related Issues:
#37
Testing: I have tested the AvailableProducts function locally and verified that it retrieves available products correctly with the expected pagination behavior.
Screenshots:
- Checklist: