[Volunteer Flow] Exit Attendance: Implement "Thank You"
Issue Summary
Overview
Implement a streamlined exit flow for volunteers in the medical camp system. This includes a dedicated "Thank You" screen and removal of obsolete certificate-related functionality to improve UI clarity and volunteer experience.
Problem Statement
- Current Behavior: When a volunteer's exit attendance is marked by an admin, the volunteer's app stays on the QR generation screen or shows confusing "Download Certificate" options that are no longer functional.
- Affected Users: All volunteers participating in medical camps.
- Impact: Volunteers are unsure if their exit has been successfully recorded and the interface remains cluttered with unused actions.
- Reproduction: Attend a camp as a volunteer, have an admin mark your exit attendance, and observe that the volunteer interface does not transition to a completion state.
Proposed Solution
-
Approach: Introduce a new
is_exitedstate in the volunteer camp status. When this state is active, the frontend will replace the QR scanner and attendance dashboard with a minimalist "Thank You" screen. -
Components to Change:
-
VolunteerCampFlow.tsx: Handle conditional rendering of the exit screen. -
QRGenerationPage.tsx: Update the status refresh logic.
-
-
Dependencies: Requires the backend to return
is_exitedin thesignup-statusAPI.
Test-Driven Development
Acceptance Criteria (Given-When-Then)
Scenario 1: Volunteer has completed attendance (Exited)
Given a volunteer is logged into the medical camp flow
And the backend returns `is_exited: true`
When the volunteer views the dashboard
Then the "Thank You for Your Service" screen should be displayed
And the QR generation button should be hidden
And the "Download Certificate" button should be hidden
Scenario 2: Volunteer refreshes status after exit record
Given a volunteer is on the QR generation screen
When the volunteer clicks "Refresh Status" and the backend returns `is_exited: true`
Then a success notification should appear
And the UI should transition to the "Thank You" screen
Test Cases
| Test ID | Test Description | Precondition | Test Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| TC-001 | Verify "Thank You" screen rendering |
is_exited is true |
1. Load dashboard 2. Check UI elements |
Appreciation message shown | High |
| TC-002 | Manual status check during exit |
is_exited transitions to true |
1. Click Refresh 2. Check toast |
Success toast + Redirect | High |
| TC-003 | Certificate button removal | Any state | 1. View dashboard | No certificate button exists | Medium |
Unit Test Requirements
Components/Functions to Test:
| Module/Component | Function/Hook | Test Cases to Cover |
|---|---|---|
VolunteerCampFlow.tsx |
Component Rendering | TC-001 |
QRGenerationPage.tsx |
handleCheckStatus |
TC-002 |
Test Assertions Required:
-
Renders correctly with initial state -
Handles user interaction (Refresh) -
Updates UI state appropriately (Exited) -
Handles success response
Implementation Details
Files to Change
| File Path | Action | Purpose |
|---|---|---|
src/pages/volunteer/VolunteerCampFlow.tsx |
Modify | Implement exit screen rendering logic |
src/pages/volunteer/QRGenerationPage.tsx |
Modify | Update status check to handle exit state |
src/types/api.ts |
Modify | Add is_exited to API types |
src/locales/en/translations.json |
Modify | Add "Thank You" messaging |
tests/volunteers/VolunteerCampFlow.test.tsx |
Modify | Add coverage for the exit UI |
tests/App.test.tsx |
Modify | Increase timeout for complex component tests |
Technical Considerations
-
State Sync: The
is_exitedflag is the single source of truth for the exit flow. -
Bundling: Removing
CertificatePagereduces redundant imports in the main bundle.
UI/UX Requirements
- Layout: Centered appreciative message with a heart icon.
- Animations: Subtle feedback when attendance is successfully verified via refresh.
- Accessibility: Ensure the "Thank You" message is readable for screen readers.
Testing Strategy
Manual Testing
Test Environment:
- Browser: Chrome
- User Role: Volunteer
Manual Test Steps:
- Navigate to the Volunteer Attendance dashboard.
- Simulate/Verify exit attendance is marked.
- Observe the transition to the "Thank You" screen.
Automated Testing
Unit Tests:
-
Component render tests (VolunteerCampFlow) -
User interaction tests (QRGenerationPage refresh) -
API integration tests (is_exited flag)
Definition of Done
-
Acceptance criteria met -
All test cases executed and passing -
Unit tests written and passing -
Manual testing completed -
No console errors or warnings -
TypeScript types defined -
ESLint/Prettier checks pass -
i18n strings externalized
Additional Context
Related Issues
- Related to backend task for
is_exitedboolean support.
References
- Volunteer Dashboard Design Spec
- Medical Camp Attendance Flow Documentation