feat: Extend Search to Beneficiaries with Filters, Pagination.....#97
Merged
BarryArinze merged 5 commits intoJun 29, 2026
Merged
Conversation
Collaborator
|
CI/CD Pipeline test failed. Please resolve it |
Contributor
Author
|
Hi @BarryArinze, pls check now. Do you have to trigger the pipeline yourself? No Job is running automatically. |
Collaborator
|
Yes I will trigger it by myself. Please resolve cothe conflicts so I can |
Contributor
Author
|
@BarryArinze, conflicts resolved. |
|
I'd like to work on this. Approach:
Estimated effort: ~1-2 hours. PR incoming shortly. |
Contributor
Author
|
@BarryArinze, pls kind check this PR. I have resolved the conflicts again. |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends search to beneficiaries with filtering, pagination, sorting, and faceted aggregation.
Closes #74.
Endpoint
GET /api/v1/search/beneficiaries— Admin/Verifier only (returns PII).Params:
q, country, city, needsCategory, verificationStatus, riskScoreMin/Max, ageMin/Max, familySizeMin/Max, page, limit, sortBy, sortOrder.Response:
{ data, pagination: { page, limit, total, totalPages }, facets }.Highlights
sortBy/verificationStatusare enum-checked before hitting Prisma.dateOfBirth;relevancefalls back to recency.drill-down semantics (each facet excludes its own active filter).
$transactionfor a consistent snapshot.idtiebreaker on every sort.needsCategoryfield; B-tree indexes on search fields +pg_trgmGIN indexes forqtext search.Migration required
Run
prisma migrate devbefore deployment; it enablespg_trgmand adds the new indexes/field.Tests
Unit tests for filters, pagination, sort, drill-down facets, and bucketing. Full suite green (pre-existing
sharp-missing storage suite excepted).