Skip to content

feat(#759): add GET /agent/:id/volunteer-linked#762

Open
nadavosa wants to merge 1 commit into
developfrom
759-agent-volunteer-linked
Open

feat(#759): add GET /agent/:id/volunteer-linked#762
nadavosa wants to merge 1 commit into
developfrom
759-agent-volunteer-linked

Conversation

@nadavosa

Copy link
Copy Markdown
Collaborator

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.tsx on the frontend, currently a stub returning nothing — see need4deed-org/fe#777).

Related Issues

Closes #759

Changes

  • New src/server/routes/agent/agent-volunteer.routes.ts — queries OpportunityVolunteer filtered by opportunity.agentId, with the same relations as the existing GET /opportunity/:id/volunteer-linked route
  • Registered under RoutePrefix.VOLUNTEER_LINKED nested under /agent/:id, mirroring agentOpportunityRoutes
  • Reuses the existing opportunityOpportunityVolunteerDTO and ApiVolunteerOpportunityGet response shape — no new SDK types needed, since this returns the same shape as the existing opportunity-scoped route
  • PII masking applied via the same makePiiSerialization hook used by sibling routes

Note

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.ts route exactly (same relation paths, same DTO), just filtering by opportunity.agentId instead of opportunityId. 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

  • WITHIN THE SCOPE OF AN ISSUE; No unnecessary files included
  • Tests added/updated — no dedicated tests added, consistent with sibling route handlers (agent-opportunity.routes.ts, opportunity-volunteer.routes.ts), which also have no route-level test coverage
  • Documentation updated
  • CI passes

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: GET /agent/:id/volunteer-linked — volunteers connected to an agent via its opportunities

1 participant