-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6960: Add pagination in the stock_movement end-point r=mbayopanda a=mbayopanda This PR adds paging in the `stock_movment` end-point. To perform queries with paging, you have to add: `?paging=true` in the HTTP request, which returns an object with two elements: ```js { rows: [], // records pager: { "total": 18, // total of records found in the database "page": 4, // the current page, pages are indexed from 1 "page_size": 5, // the number of records returned by pages "page_min": 15, // the minimum counted record of the page "page_max": 20, // the maximum counted record of the page "page_count": 4 // the total of pages } // pagination information } ``` To test the feature: - Log into BHIMA (with browser or REST Tools) - Go to this route: `stock/lots/movements/?paging=true` to have pager information - Go to this route: `stock/lots/movements/?paging=true&page=2` to have page 2 of records - Go to this route: `stock/lots/movements/?paging=true&page=2&limit=10` to have page 2 when the number of records on each page must be 10 This feature is enabled for these end-points: - `/stock/lots/depots/` : for getting the list of lots with their quantities (see Lots in stock registry) - `/stock/lots/depotsDetailed/` : for getting the detailed list of lots (see Lots in stock registry) - `/stock/lots/movements/` : for getting the list of stock movements made (see Stock movements registry) - `/stock/inventories/depots/` : for getting the list of inventories without consideration of lots (see Article in stock registry) Co-authored-by: mbayopanda <mbayopanda@gmail.com>
- Loading branch information
Showing
4 changed files
with
155 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
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