HIGH story-quick-activity-registration-peer-mentor-010 3 pts
3
Story Points
High
Priority
Quick Activity Registration
Feature

User Story

As a Peer Mentor (Likeperson)
I want to see a summary of how many activities I have registered this month and this year directly on my home screen
So that I feel recognised for my contributions and can easily verify that my registrations are being captured

Audience Summaries

Displaying a peer mentor's personal activity statistics on the home screen directly addresses a key motivational driver identified in both NHF and HLF stakeholder workshops: visibility of personal contribution. Peer mentors who can see their own cumulative impact — this month's activity count, total hours invested, and year-to-date progress — are measurably more likely to log consistently and remain engaged with the programme over time. This story lays the gamification foundation for the planned Phase 4 'Din likepersonsårek' (Spotify Wrapped-style) annual summary feature, meaning the investment here compounds in future product value. Higher logging consistency directly improves data completeness for Bufdir reporting, protecting outcome-based funding.

The stat cards also serve as an early-warning mechanism: if a mentor's count drops unexpectedly, they may notice a sync issue before it compounds into a reporting gap. This is a high-value, relatively low-risk story that strengthens both retention and data quality simultaneously, delivering tangible return on development investment from day one of release.

This high-priority story has a clear dependency on the quick-activity-registration story (story-quick-activity-registration-peer-mentor-001) and should be sequenced immediately after that work is stable. Scope is well-defined: three stat cards (this month count, total hours this month, year-to-date count), a stats repository with local caching for offline support, navigation from each card to the personal statistics view with appropriate filter context, and reactive updates after new registrations are submitted. The offline caching requirement adds moderate complexity — the stats repository must cache the last-known values and surface a 'Last updated X ago' indicator, requiring coordination with the offline/sync work from story 741. UAT scenarios are clearly specified across five acceptance criteria covering initial load, data accuracy, tap-to-navigate behaviour, offline cached display, and post-submission refresh.

Cross-team dependencies include the stats repository (backend/data), the home screen layout (mobile UI), and the personal statistics view (navigation target). Timeline risk is low if the stats API is available; cache-staleness UX should be reviewed with design before implementation to align on the indicator format.

Implementation requires building or extending a stats repository that aggregates activity counts and hours for three time windows: current calendar month count, current month total hours, and year-to-date count. The repository must support local caching — persist the last-fetched values to SQLite or a key-value store, and expose a 'last updated' timestamp for the offline indicator UI. The home screen component consumes the stats repository and renders three tappable stat cards; each card's onPress handler navigates to the personal statistics view with the appropriate time-range filter pre-applied (e.g., current month for the first two cards). Reactive updates after registration submission require either a repository-level event/stream that the home screen observes, or a manual refresh triggered when the home screen regains focus after the registration flow completes.

Ensure the stats query is efficient — avoid full table scans on large activity histories by indexing on peer_mentor_id and activity_date. Edge cases: mentor with zero activities (display '0', not a loading state), stats fetch failure while online (show cached values with error indicator), and the year boundary (YTD resets correctly on January 1). The offline 'Last updated X ago' indicator should use relative time formatting and update passively without polling.

Acceptance Criteria

  • Given I am on the peer mentor home screen, when the screen loads, then I see at minimum three stat cards: 'This month', 'Total hours this month', and 'This year'
  • Given I have registered 5 activities this month, when I view the home screen, then the 'This month' card displays 5
  • Given I tap the 'This month' stat card, when it is tapped, then I am navigated to the personal statistics view filtered to the current month
  • Given I am offline, when I open the home screen, then the last cached stat values are shown with a subtle 'Last updated X ago' indicator
  • Given I submit a new activity registration, when I return to the home screen, then the stat counts update to reflect the new submission

Business Value

Visibility of personal contribution is a key motivational driver identified in both NHF and HLF workshops. Peer mentors who can see their own impact are more likely to log consistently and remain engaged. This lightweight feedback loop also serves as a quality signal — if a mentor's count drops unexpectedly they may notice a sync issue before it compounds.