Adjust Calculation Period and Input Parameters
The calculator input panel provides period selection controls that allow the peer mentor to switch between preset periods (current year, last 6 months, all time) or enter a custom date range. When inputs change, the benefit-calculator-bloc triggers a recalculation through the benefit-calculation-service, which re-queries the activity-summary-aggregator for the new period and recomputes results using the benefit-multiplier-config-repository. The UI updates reactively with smooth transitions. Input changes are debounced to avoid redundant API calls. The panel is designed with cognitive accessibility in mind: large touch targets, plain-language labels, and no more than three primary controls visible at once.
User Story
Acceptance Criteria
- Given the peer mentor is on the Benefit Calculator screen, When they tap a period preset in the calculator-input-panel, Then the benefit-calculator-bloc triggers recalculation and the results update within 2 seconds
- Given the peer mentor selects a custom date range, When both start and end dates are valid and the range does not exceed 3 years, Then the calculation executes and results display for that exact period
- Given an invalid date range is entered (end before start), When the peer mentor attempts to calculate, Then a plain-language inline error is shown and calculation is blocked until corrected
- Given the peer mentor rapidly switches between period presets, When debounce logic is active, Then only the final selected period triggers a network request, preventing redundant calls
- Given the input panel renders, When the screen is assessed by the accessibility audit service, Then all interactive controls meet WCAG 2.2 AA touch target size minimums (44x44 logical pixels)
Business Value
Allowing peer mentors to explore their contributions across different time periods increases engagement with the feature and reinforces long-term commitment. Seeing year-over-year growth in calculated benefit creates a sense of progress and personal achievement — a key motivator for sustained volunteerism identified in the workshop findings (Spotify Wrapped analogy). Debounced, responsive inputs also reduce infrastructure costs by minimizing unnecessary API calls.
Components
- Calculator Input Panel ui
- Benefit Calculator BLoC infrastructure
- Benefit Calculation Service service
- Activity Summary Aggregator service
- Benefit Multiplier Config Repository data
- Benefit Calculation Result Model data