Refactor(API): Refactor the existing /next-for-review for filter support
Refactor(API): Refactor the existing /next-for-review for filter support
🔌 API Issue
Describe the API issue
Refactor the exiting /next-for-review to support comprehensive filtering for it to be used for multiple cases like peer-review infinite scroll and proof-reading tool. The mandatory filters are:
- Language
- Media_type
- has_unproofread_segments
- category_ids
- source_label
- release_rights
- published_date
New Features
-
Note: Rather than adding the filters as parameters which could make the api url lenghtly. create a request schema for the filters so we can add validations to it.
API Endpoint (if applicable)
get /records/next-for-review
Request/Response examples (if applicable)
Provide examples of the request and response that illustrate the issue.
Expected behavior
API Usage Examples
Get single record for review
1 POST /records/for-review
2 {
3 "limit": 1
4 }
Get Hindi audio records needing proofreading
1 POST /records/for-review
2 {
3 "filters": {
4 "language": ["hindi"],
5 "media_type": ["audio"],
6 "has_unproofread_segments": true
7 },
8 "limit": 20
9 }
Get records with category A OR B
1 POST /records/for-review
2 {
3 "filters": {
4 "category_ids": ["uuid-a", "uuid-b"]
5 },
6 "limit": 20
7 }
Get records from specific source
1 POST /records/for-review
2 {
3 "filters": {
4 "source_label": "Radio",
5 "release_rights": "creator"
6 },
7 "limit": 50
8 }
Additional context
Add any other context about the API issue here.
📌 Follow semantic issue titling convention:<type>(<scope>): <description>(e.g.,feat(api): add user registration endpointorfix(records): handle null values).