Join the contributor Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
loanController.getBorrowerLoans returns paginated borrower loans, but only filters by borrower. Borrowers with longer histories want filtering by status (active, repaid, defaulted, liquidated, pending) and a date range. Without these, the loan list page is hard to use after even a few months of activity.
Acceptance criteria
Files to touch
backend/src/controllers/loanController.ts
backend/src/schemas/loanSchemas.ts
backend/src/routes/loanRoutes.ts
backend/migrations/ (only if a new index is needed)
backend/src/__tests__/loanEndpoints.test.ts
Out of scope
- Adding the same filters to the admin endpoints.
- Wiring the filter UI in the frontend (separate frontend issue).
Join the contributor Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
loanController.getBorrowerLoansreturns paginated borrower loans, but only filters by borrower. Borrowers with longer histories want filtering by status (active,repaid,defaulted,liquidated,pending) and a date range. Without these, the loan list page is hard to use after even a few months of activity.Acceptance criteria
statusandfrom/toquery params, validated with Zod.(borrower, status, created_at)index is present (file migration if not).@swaggerJSDoc.Files to touch
backend/src/controllers/loanController.tsbackend/src/schemas/loanSchemas.tsbackend/src/routes/loanRoutes.tsbackend/migrations/(only if a new index is needed)backend/src/__tests__/loanEndpoints.test.tsOut of scope