Add Blindeforbundet assignment count badge to contacts list
epic-peer-mentor-detail-screen-ui-components-task-010 — Extend AssignedContactsList rows to display a Blindeforbundet-specific badge showing the open assignment count and deadline for the 3rd and 15th assignment thresholds (office-fee triggers). Badge must be conditionally rendered only for Blindeforbundet orgs using OrgLabelsProvider org type flag. Visually distinguish the 3rd and 15th threshold milestones with different badge colors.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 2 - 518 tasks
Can start after Tier 1 completes
Implementation Notes
Extend the AssignedContact model from task-009 with two nullable fields: int? openAssignmentCount and DateTime? assignmentDeadline. The badge should only render if: (1) OrgLabelsProvider indicates Blindeforbundet AND (2) the count is exactly 3 or 15.
Implement a private _AssignmentMilestoneBadge(int count, DateTime deadline) widget. Use a switch/if on count to select the badge color from design tokens — introduce two new tokens if they don't exist: colorMilestone3 (amber-ish) and colorMilestone15 (a distinct warm color, e.g., deep orange). Do NOT use hardcoded hex values. For OrgLabelsProvider integration, use context.watch
Format the deadline date using intl package's DateFormat('dd.MM.yyyy') — verify intl is already a project dependency before adding it. The Blindeforbundet office-fee trigger at 3rd and 15th assignments is a business rule described in the source documentation — add a code comment referencing this context for future maintainers.
Testing Requirements
Write widget tests using flutter_test with a mock OrgLabelsProvider injected via the widget tree (use ProviderScope overrides if using Riverpod, or InheritedWidget mock). Test 1: inject non-Blindeforbundet org — assert no badge widget in tree. Test 2: inject Blindeforbundet org, contact with openAssignmentCount=3 — assert badge is present and its decoration color matches the milestone-3 token. Test 3: inject Blindeforbundet org, contact with openAssignmentCount=15 — assert badge color matches milestone-15 token and color differs from milestone-3.
Test 4: inject Blindeforbundet org, contact with openAssignmentCount=7 — assert badge is absent (or present in neutral, per spec). Test 5: assert badge Semantics label contains the count and deadline string.
The org labels system may not yet have label keys defined for peer mentor detail screen terminology (role labels, section headings), requiring additions to the label key registry that must be coordinated with the admin configuration team.
Mitigation & Contingency
Mitigation: Audit existing label keys in the terminology system before starting OrgLabelsProvider integration. Submit required new label keys for admin configuration in parallel with component implementation.
Contingency: If label keys are not available at integration time, use hardcoded English fallbacks with a clear TODO for admin configuration, ensuring the widget renders correctly while keys are being provisioned.
The design token semantic colors (warning, error surface) may not meet WCAG 2.2 AA 4.5:1 contrast ratio when rendered on the app's background surface tokens, requiring design system changes that affect the entire app.
Mitigation & Contingency
Mitigation: Run contrast ratio validation on the token palette during Epic 1 design token implementation. Flag any failing pairs to the design system owner before building UI components that depend on them.
Contingency: If tokens fail contrast requirements, define supplementary high-contrast override tokens specific to alert and badge contexts that meet AA without modifying the global palette.