cht-core
cht-core copied to clipboard
feat(#9193): add functionality of getting places as pages or async iterables in cht-datasource
Description
Added functionality of getting places using pages or as AsyncGenerator
using cht-datasource
along with the addition of REST endpoint /api/v1/person
which provides people as pages.
Issues: #9239 , #9240 , #9242
Usage:
- Pagination API
Place.v1.getPageByType(Qualifier.byContactType(placeType), cursor, limit); // limit and cursor are optional with defaults as 100 and "0" respectively
- Async Generator API
const getAllIterator = Place.v1.getByType(ctx)(Qualifier.byContactType('place'));
- REST API endpoint
HTTP GET api/v1/place
Query Params:
- placeType - the
contact_type
of the place to fetch - limit - default is 100
- cursor - default is 0
Code review checklist
- [X] Readable: Concise, well named, follows the style guide, documented if necessary.
- [X] Documented: Configuration and user documentation on cht-docs
- [x] Tested: Unit and/or e2e where appropriate
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.