Remember to take your time and work through each question diligently! Test your code, make sure it works, and try to find ways to improve. Once you are happy and satisfied with your code, upload it to Github, then turn in your Github link at the bottom of the page!
Don't forget. Make sure this assignment is in it's own repository. Not mixed in with others!
Implementing Pagination in the Factory Management System
Objective: The objective of this assignment is to enhance the factory management system by implementing pagination for retrieving orders and products efficiently using Flask.
Problem Statement: You are tasked with extending the factory management system to support pagination for retrieving orders and products. Pagination allows for fetching large datasets in smaller, manageable chunks, improving system performance and user experience.
Task 1: Implement Pagination for Orders
Modify the existing endpoint
/orders
to support pagination by adding query parameters forpage
andper_page
.Implement pagination logic in the backend to retrieve orders in batches based on the provided parameters.
Task 2: Implement Pagination for Products
Update the
/products
endpoint to incorporate pagination functionality similar to the orders endpoint.Adjust the backend logic to fetch products in paginated form based on the specified parameters.
Task 3: Test Pagination Endpoints
Test the pagination endpoints
/orders
and/products
using various combinations ofpage
andper_page
parameters.Verify that the endpoints return the expected results and handle edge cases such as out-of-range page numbers gracefully.
For added challenge incorporate a search_term route that is also paginated
Expected Outcomes:
Upon completing this assignment, students should achieve the following outcomes:
Implementation of pagination functionality for retrieving orders and products, improving system performance and user experience.
Integration of pagination logic into the existing factory management system, ensuring seamless interaction with large datasets.
Successful testing of pagination endpoints to validate correct functionality and handle edge cases effectively.