Adam Saghy created FINERACT-2167:
------------------------------------
Summary: Handle sorting and pagination better
Key: FINERACT-2167
URL: https://issues.apache.org/jira/browse/FINERACT-2167
Project: Apache Fineract
Issue Type: Improvement
Affects Versions: 1.10.0
Reporter: Adam Saghy
Assignee: Adam Saghy
Fix For: 1.11.0
During the years, many different sorting and pagination solution got
implemented in Fineract.
*What better than having N different solution?*
An N+1 that would be better than the predecessors ;)
The idea is similar like Spring REST is handling. REST API incoming parameter
accepts Pageable class.
While Fineract is not using Spring REST capabilities rather JAX-RS and Jersey
implementation, but we can achieve something really similar:
* Create a new ParamProvider for Jersey
** From the incoming request fetch the needed informations
*** page
*** size
*** sort
** Create a new Pageable object with the data
** Via the param provider return the created Pageable object
* Create a new annotation: Pagination
** size / value can be provided, default: 50
** maximum size: 10000 (hard limit)
* Making it more convenient lets support some additional annotations (from
Spring Web):
** PageableDefault
** SortDefault
The 1st API that will support this is the `Loan locking API - Fetch locked
loans`
--
This message was sent by Atlassian Jira
(v8.20.10#820010)