Add nonprofit sorting functionality #72
Open
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.
Closes #62
Overview
This PR implements sorting and filtering capabilities for the nonprofits GraphQL endpoint. The goal was to enable users to sort nonprofits alphabetically (A-Z and Z-A), by most recent project start date, and by status (ACTIVE/INACTIVE), as well as filter nonprofits by chapter IDs and status.
Key Changes:
NonprofitSortOptionenum with four sorting options:A_TO_Z,Z_TO_A,MOST_RECENT, andSTATUSstatusfield to theNonprofitGraphQL typenonprofitsquery to accept optionalchapterIds,statuses, andsortparametersImplementation Details:
nonprofit_chapter_projectrelationships (ACTIVE if there's an ongoing project, INACTIVE otherwise)Testing
Unit Tests:
tests/unit/services/nonprofits.service.test.tscovering:Integration Tests:
tests/integration/graphql/nonprofits-sorting.test.tswith end-to-end GraphQL tests:All tests pass successfully. The implementation maintains backward compatibility - existing queries without the new parameters continue to work as before.
Screenshots / Screencasts
N/A - This is a backend API change with no frontend components affected.
Checklist
Notes