Legal API - update GET /batches endpoint to support filtering by column
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 62
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
First cut of GET /admin/batches endpoint which supports paging and sorting should have been implemented in #22618.
This ticket is to build on the existing endpoint code to support filtering of batches by column values. Designs can be found [here](https://www.figma.com/design/LcP4NgVYKVxEk8V7fXWIuc/Involuntary-Dissolution-%26-Delay-of-Dissolution?node-id=1115-1404&t=2YmOJ1Zs63J7mdGr-0).
**There is probably going to need to be some clarifications around the designs as it is unclear if it’s just straight text filtering for each column. For example, is there a need to provide a drop down of statuses and can you filter on more than one status?**
**GET /admin/batches endpoint URL structure**
```
GET /api/v2/admin/batches?page=1&page_size=2&sort_by=&sort_order=desc
&id=1
&batch_type=
&created_date=2024-06-25
&end_date=
&status=COMPLETED
&size=300
&max_size=600
```
**Sample response from GET /admin/batches endpoint**
Note that we will be returning all columns in the `batches` table. It will be up to the UI to decide which columns to use.
```json
{
"batches": [
{
"id": 1,
"created_date": "2024-06-25",
"end_date": "2024-08-26",
"status": "COMPLETED",
"size": 344,
"max_size": 600,
"batch_type": "INVOLUNTARY_DISSOLUTION",
"notes": null
}
],
"total": 1,
"pages": 1,
"current_page": 1
}
```
**TODOs**
- [ ] Update GET /admin/batches endpoint to support filtering by column values. Clarify how each column filter should work before starting work.
Following columns should be supported
- [ ] id
- [ ] batch_type
- [ ] created_date
- [ ] end_date
- [ ] status
- [ ] size
- [ ] max_size
- [ ] Add/update unit test as required
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.