Skip to content

feat: volunteer profile completion after email confirmation #956

Description

@nadavosa

Description

Continuation of #954 / #955 (volunteer self-registration). Once a volunteer confirms their email, they currently land nowhere meaningful, this issue adds the missing step: a "volunteer profile" form, pre-filled with the account details they already entered (name, email, phone) and empty for everything else, that opens right after they click the confirmation link in their email.

This mirrors the existing agent flow exactly:

  • verify-email/[token]/page.tsx already branches on the registering role: after verifying, an "agent" is sent to /register/agent/complete?token=<verify-token>, forwarding the same JWT as a query param (not a logged-in session), where ProfileCompletion.tsx collects the rest of the org's details and does POST /agent/register?token=....
  • Today a volunteer isn't branched at all, verify-email falls into the else case and pushes straight to /dashboard with no session established, which likely just bounces to login. Extend that page to also check for role=volunteer and redirect to the new completion route, same token-forwarding pattern.

Fields to collect

The public "become a volunteer" form (src/components/forms/BecomeVolunteer/, VolunteerFormData) already defines the full field shape we need: postcode, districts, availability, languages, activities, skills, certificate of good conduct, measles vaccination proof, how they heard about us, comments. Reuse that shape/component where practical rather than re-designing the fields. First/last name, email, and phone are already known from the account step and shouldn't be asked again.

Backend work required (unlike #954, this one isn't fe-only)

Checked the be repo: there's no self-service way for an authenticated volunteer to create their own profile today.

  • POST /volunteer/legacy is public/anonymous and not linked to any Person/User account, it's the legacy form's endpoint, not reusable as-is.
  • POST /volunteer (the real volunteer route) requires fastify.authenticate() and role: UserRole.COORDINATOR, a self-registering volunteer can't call it.
  • Volunteer.personId is a straightforward @ManyToOne(Person), the same Person a self-registered volunteer's User already points to, so linking is structurally simple, but the endpoint/authorization to do it doesn't exist.

This needs a paired be issue for a self-service endpoint analogous to POST /agent/register, e.g. POST /volunteer/register?token=..., that verifies the token and creates the Volunteer linked to the already-created Person. Please file (or point me to) that be issue before implementation starts here.

Scope

  • Extend verify-email/[token]/page.tsx to redirect a confirmed volunteer to the new completion route.
  • New route/component (e.g. /register/volunteer/complete), analogous to AgentRegistration/ProfileCompletion/, pre-filled with nothing (name/email/phone aren't shown again since they're already saved), collecting the remaining VolunteerFormData fields.
  • Depends on the paired be endpoint above.

Related

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions