Assignment Status Tracking
Feature Detail
Description
This feature provides a structured overview of all assignments in the system, allowing coordinators to monitor the lifecycle of each assignment from dispatch through completion or closure. It surfaces open assignments that have not been acted upon, highlights those approaching or past the 10-day auto-reminder threshold, and records the full status timeline for audit and accountability purposes. Peer mentors see only their own assignments with clear status indicators, while coordinators have a cross-peer-mentor view filtered by team or organization unit.
Analysis
Blindeforbundet identified untracked open assignments as a significant operational risk — vulnerable individuals may go without contact if assignments fall through the cracks. The 10-day auto-reminder rule formalizes a safeguard that previously depended on individual coordinator memory. Providing a structured status timeline also satisfies Bufdir's requirement for evidence of activity, supporting the organization's grant reporting obligations. For coordinators managing large peer mentor teams, the cross-team overview eliminates the need to contact individual peer mentors to check on assignment progress, substantially reducing administrative overhead and allowing coordinators to focus on higher-value supervision tasks.
Model assignment lifecycle as a finite state machine with states: dispatched, delivered, read, accepted, in_progress, completed, escalated, closed. State transitions are recorded as immutable rows in assignment_dispatches and assignment_status_repository tables to preserve the full audit trail. The auto-reminder is implemented as a Supabase scheduled Edge Function (cron) that queries assignments where last_state_change is older than the configured threshold and no completion event exists, then enqueues a push notification via the push notification service. The Flutter UI renders a vertical timeline widget using the assignment_dispatches history. Coordinator view uses Supabase Realtime to stream state changes without polling. Role-based row-level security in Supabase ensures peer mentors see only their own rows while coordinators see their team scope.
Dependencies
Definition of Done
Components (9)
User Stories (10)
As a As a Coordinator
I want I want to filter the cross-team assignment list by status, individual peer mentor, team, or time range
So that So that I can focus on specific subsets of assignments when managing a large team without losing context
- Given I am on the coordinator assignment status screen, when I open the filter bar, then I see filter options for: lifecycle state, peer mentor, team/organizational unit, and time range
- Given I select a lifecycle state filter (e.g., 'Dispatched'), when the filter is applied, then only assignments in that state are shown in the list
- Given I select a specific peer mentor from the filter, when the filter is applied, then only that peer mentor's assignments are shown
- +4 more
As a As a Coordinator
I want I want my assignment status view to update automatically when any peer mentor changes assignment state
So that So that I always have an accurate, live picture of my team's assignment activity without needing to manually refresh the screen
- Given I have the assignment status screen open as a coordinator, when a peer mentor in my team changes their assignment state, then my screen updates to reflect the new state within 5 seconds without any manual action
- Given the real-time subscription is active, when a new assignment is dispatched to a peer mentor in my scope, then it appears in my list automatically
- Given the Supabase Realtime connection drops (e.g., brief network interruption), when connectivity is restored, then the subscription automatically reconnects and back-fills any missed state changes
- +3 more
As a As a user
I want I want assignments approaching or past the 10-day follow-up threshold to be visually highlighted
So that So that I can immediately identify which assignments require urgent attention without reading through dates manually
- Given an assignment with a last state change less than 7 days ago and no completion event, when the badge renders, then it shows a neutral style with no urgency indication
- Given an assignment with a last state change between 7 and 9 days ago and no completion event, when the badge renders, then it shows an amber 'Approaching' badge with the number of elapsed days
- Given an assignment with a last state change 10 or more days ago and no completion event, when the badge renders, then it shows a red 'Overdue' badge with the number of elapsed days
- +3 more
As a As a Peer Mentor (Likeperson)
I want I want to see a clear list of all my assignments with their current status
So that So that I always know which assignments I need to act on and which are complete
- Given I am authenticated as a peer mentor, when I navigate to the assignment status screen, then I see only my own assignments — no other peer mentor's assignments are visible
- Given my assignment list is loaded, when I view the list, then each item shows the assignment title, current lifecycle state, and the date of the last state change
- Given an assignment has not had a state change for 7 or more days and is not completed, when the list renders, then the item shows an urgency badge indicating the approaching threshold
- +3 more
As a As a user
I want I want to tap into any assignment and see its complete chronological state history
So that So that I have a full audit trail showing exactly when each state transition occurred and who triggered it
- Given I am viewing the assignment list, when I tap on any assignment I have permission to view, then I navigate to the assignment detail with a vertical status timeline
- Given the timeline is rendered, when I view it, then each node shows the state label (e.g., 'Dispatched', 'Delivered', 'Read', 'Accepted', 'In Progress', 'Completed'), the exact timestamp, and the actor who triggered the transition
- Given the assignment has passed through multiple states, when the timeline renders, then all states are shown in chronological order from oldest (top) to most recent (bottom)
- +3 more
As a As a Peer Mentor (Likeperson)
I want I want to receive a push notification when I have not acted on an assignment within the configured reminder threshold
So that So that I am prompted to follow up on assignments I may have missed or forgotten, preventing vulnerable contacts from going without support
- Given I have an assignment in a non-terminal state (not completed or closed) with no state change for 10 or more days, when the daily reminder cron job runs, then I receive a push notification on my device
- Given the push notification is delivered, when I tap it, then I am navigated directly to the relevant assignment detail screen
- Given the push notification content, when I read it, then it clearly identifies which assignment requires follow-up by name and how many days have elapsed
- +3 more
As a As a user
I want I want assignments approaching or past the 10-day follow-up threshold to be visually highlighted
So that So that I can immediately identify which assignments require urgent attention without reading through dates manually
- Given an assignment with a last state change less than 7 days ago and no completion event, when the badge renders, then it shows a neutral style with no urgency indication
- Given an assignment with a last state change between 7 and 9 days ago and no completion event, when the badge renders, then it shows an amber 'Approaching' badge with the number of elapsed days
- Given an assignment with a last state change 10 or more days ago and no completion event, when the badge renders, then it shows a red 'Overdue' badge with the number of elapsed days
- +3 more
As a As a user
I want I want to tap into any assignment and see its complete chronological state history
So that So that I have a full audit trail showing exactly when each state transition occurred and who triggered it
- Given I am viewing the assignment list, when I tap on any assignment I have permission to view, then I navigate to the assignment detail with a vertical status timeline
- Given the timeline is rendered, when I view it, then each node shows the state label (e.g., 'Dispatched', 'Delivered', 'Read', 'Accepted', 'In Progress', 'Completed'), the exact timestamp, and the actor who triggered the transition
- Given the assignment has passed through multiple states, when the timeline renders, then all states are shown in chronological order from oldest (top) to most recent (bottom)
- +3 more
As a As a Coordinator
I want I want to be notified when an assignment in my team exceeds the 10-day follow-up threshold and the peer mentor has not responded
So that So that I can directly intervene and ensure the assignment is actioned, fulfilling my supervisory responsibility
- Given a peer mentor in my team has an assignment exceeding the 10-day threshold, when the cron job runs, then I receive a push notification or in-app alert identifying the peer mentor and assignment
- Given the coordinator notification is received, when I open the assignment status screen, then the overdue assignment is visible with an overdue urgency badge and appears prominently in the list
- Given the coordinator notification content, when I read it, then it includes the peer mentor's name, assignment title, and the number of days elapsed since last state change
- +3 more
As a As a Coordinator
I want I want to see the assignment status for all peer mentors within my organizational scope
So that So that I can proactively identify which assignments need follow-up without contacting each peer mentor individually
- Given I am authenticated as a coordinator, when I open the assignment status screen, then I see assignments from all peer mentors within my organizational scope
- Given the coordinator view is loaded, when a peer mentor's assignment changes state, then the change is reflected in my view within 5 seconds without requiring a manual refresh
- Given multiple assignments exist, when I scan the list, then each row shows the peer mentor name, assignment title, current state, and days since last state change
- +3 more