feat(#759): add GET /agent/:id/volunteer-linked#762
Open
nadavosa wants to merge 1 commit into
Open
Conversation
Returns all volunteers matched to any of the agent's opportunities, so the NGO/agent profile's Volunteers section has a real data source (currently a stub — see fe#777). Mirrors the existing GET /opportunity/:id/volunteer-linked route: same relations, same DTO (opportunityOpportunityVolunteerDTO), same ApiVolunteerOpportunityGet response shape — no new SDK types needed.
4 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.
Description
Adds
GET /agent/:id/volunteer-linked, returning all volunteers matched to any of the agent's opportunities. This is the missing data source for the NGO/agent profile's "Volunteers" section (VolunteerAgents.tsxon the frontend, currently a stub returning nothing — see need4deed-org/fe#777).Related Issues
Closes #759
Changes
src/server/routes/agent/agent-volunteer.routes.ts— queriesOpportunityVolunteerfiltered byopportunity.agentId, with the same relations as the existingGET /opportunity/:id/volunteer-linkedrouteRoutePrefix.VOLUNTEER_LINKEDnested under/agent/:id, mirroringagentOpportunityRoutesopportunityOpportunityVolunteerDTOandApiVolunteerOpportunityGetresponse shape — no new SDK types needed, since this returns the same shape as the existing opportunity-scoped routemakePiiSerializationhook used by sibling routesNote
Couldn't run this against a live Postgres in my working environment to smoke-test end-to-end — the query mirrors the existing, working
opportunity/opportunity-volunteer.routes.tsroute exactly (same relation paths, same DTO), just filtering byopportunity.agentIdinstead ofopportunityId. Typecheck and lint are clean; full test suite passes except two pre-existing DB-connectivity sanity checks that fail without a live Postgres (unrelated to this change). Would appreciate a run against a real dev DB before merging.Checklist
agent-opportunity.routes.ts,opportunity-volunteer.routes.ts), which also have no route-level test coverage