Build Pause Status Indicator UI widget
epic-peer-mentor-pause-management-foundation-task-011 — Implement the PauseStatusIndicator Flutter widget that visually represents a peer mentor's current pause state (active, paused, suspended). Use design token color coding, include an icon and label, and expose an onTap callback for navigation to detail. Ensure the widget is accessible with proper semantics labels.
Acceptance Criteria
Technical Requirements
Implementation Notes
Create the widget in lib/features/peer_mentor/widgets/pause_status_indicator.dart. Define a PeerMentorStatus enum (or reuse existing) in a shared types file. Use a switch expression or Map
Wrap the entire widget in a Semantics widget with label built from a localized string. Use ExcludeSemantics on the Icon to prevent double-announcement. For the touch target, wrap in a SizedBox with minHeight: 48 if the visual size is smaller. Keep the widget a pure StatelessWidget to make it trivially testable and reusable across coordinator and mentor views.
Testing Requirements
Write Flutter widget tests using flutter_test covering: (1) rendering for each of the three PeerMentorStatus enum values; (2) correct design token color and icon per state; (3) onTap callback fires exactly once on tap when provided; (4) onTap is not invoked when null; (5) Semantics node has correct label for each state; (6) minimum touch target size assertion (>=48dp). Golden image tests for each state snapshot. No integration tests required for this widget alone.
Supabase RLS policies for coordinator-scoped status queries may be difficult to express correctly, especially for peer mentors assigned to multiple coordinators or chapters, leading to data leakage or overly restrictive access blocking valid queries.
Mitigation & Contingency
Mitigation: Design RLS policies using security-definer RPCs rather than table-level policies for complex multi-coordinator scenarios. Write a comprehensive RLS test matrix covering all role and assignment permutations before marking complete.
Contingency: Fall back to application-level filtering in the repository layer with explicit coordinator_id parameter checks if RLS proves intractable, and document the trade-off for security review.
The HLF Dynamics portal API contract may be undocumented or subject to change, causing the DynamicsPortalClient to break during development or production rollout.
Mitigation & Contingency
Mitigation: Obtain the full Dynamics portal API specification and credentials early in the sprint. Build the client behind a well-defined interface so the HLF-specific implementation can be swapped without affecting upstream services.
Contingency: If the Dynamics API is unavailable or unstable, stub the client with a feature-flag-guarded no-op implementation so all other epics can proceed to completion independently.
Supabase Edge Functions used as the nightly scheduler host may have cold-start latency or execution time limits that prevent reliable nightly certification checks on large mentor rosters.
Mitigation & Contingency
Mitigation: Benchmark Edge Function execution time against the expected roster size. Design the expiry check to process in paginated batches to stay within execution limits. Use pg_cron with a direct database function as an alternative trigger if Edge Functions prove unreliable.
Contingency: Migrate the scheduler trigger to pg_cron invoking a Postgres function directly, removing the Edge Function dependency entirely for the scheduling layer.