Bulk Registration & Proxy Reporting
Feature Detail
Description
Bulk Registration & Proxy Reporting enables coordinators to register activities on behalf of peer mentors who cannot or choose not to use the app directly, either one at a time or in batch for recurring fixed activities. The bulk registration screen lets a coordinator select multiple peer mentors and a shared activity template, submitting all registrations in a single action. The proxy registration screen supports individual proxy submissions with full wizard fidelity on behalf of a chosen peer mentor. This feature merges Bulk Registration, Coordinator Proxy Reporting, and Report on Behalf of Others workflows.
Analysis
Not all peer mentors are digitally confident or willing to adopt the app immediately. If the app cannot accommodate proxy reporting from day one, coordinators face a split workflow — app for some, paper/Excel for others — which defeats the consolidation goal and risks coordinator rejection of the tool entirely. NHF and HLF both explicitly requested bulk and proxy capabilities. For recurring weekly activities shared by many participants, bulk registration compresses hours of data entry into seconds. Ensuring coordinators can operate the entire reporting pipeline from within the app is essential to achieve the parallel-systems transition without regression.
Proxy registration is implemented as a role-guarded route available only to coordinator and admin roles, enforced at both the Flutter navigation layer and via Supabase RLS policies that check the acting user's role before allowing inserts on behalf of another user_id. The delegation_grants table records which coordinator submitted on whose behalf, preserving auditability. Bulk registration uses a batch insert Supabase RPC call wrapped in a database transaction so all-or-nothing semantics apply; partial failures surface a per-row error list rather than a silent discard. The peer mentor selection widget reuses the Contact Repository with a 'peer_mentor' filter. BLoC handles the multi-select state and tracks submission progress per mentor during the batch operation.
Dependencies
Definition of Done
Components (7)
User Stories (7)
As a As a Coordinator
I want I want to query and review which activities were registered on behalf of which peer mentors and by which coordinator
So that So that I can verify submission history, resolve disputes about missing or incorrect activity records, and demonstrate accountability to auditors or administrators
- Given the coordinator queries the delegation audit trail, when results are returned, then each record shows the acting coordinator, the subject peer mentor, the activity ID, and the submission timestamp
- Given the coordinator filters by a specific peer mentor, when the filter is applied, then only delegation records for that mentor are displayed
- Given the coordinator filters by date range, when the filter is applied, then only records within that range are shown
- +2 more
As a As a Coordinator
I want I want to search by name and filter by status or other attributes when selecting peer mentors in the bulk or proxy registration flow
So that So that I can quickly locate the correct peer mentors in a large list without scrolling through every record, reducing selection errors and saving time
- Given the peer mentor selection widget is rendered in bulk registration mode, when the coordinator types in the search field, then the list filters in real time to show only mentors whose names match the query
- Given the widget is in multi-select mode, when the coordinator taps a mentor row, then a checkbox toggles and the mentor is added to the selection chip list
- Given the widget is in single-select mode (proxy registration), when the coordinator taps a mentor, then that mentor is immediately selected and the wizard advances to the next step
- +2 more
As a As a Coordinator
I want I want to see a real-time status indicator for each peer mentor in a batch submission showing pending, success, or failure states as the batch processes
So that So that I can immediately identify which registrations succeeded and which require attention, without waiting for a single pass/fail result that obscures granular outcomes
- Given a bulk submission is in progress, when the coordinator views the Batch Submission Progress Widget, then each selected mentor is listed with a pending indicator until their result is received
- Given a mentor's activity insert succeeds, when the result is returned, then that mentor's row transitions to a success state showing a confirmation and the activity date
- Given a mentor's activity insert fails, when the error is returned, then that mentor's row transitions to an error state with a human-readable reason and the row is visually distinguished from successful rows
- +2 more
As a As a Coordinator
I want I want to retry only the failed rows from a bulk submission directly from the batch progress widget without clearing the successful results or resubmitting the entire batch
So that So that a transient network error or validation issue affecting one or two mentors does not require me to redo work already successfully completed for the rest of the group
- Given at least one mentor row is in error state after a bulk submission, when the coordinator taps the retry action on that row, then only that mentor's activity insert is resubmitted
- Given a retry submission succeeds, when the result is received, then the row transitions from error to success state and a delegation_grants record is created
- Given a retry submission fails again, when the error is returned, then the row remains in error state with an updated error reason
- +2 more
As a As a Coordinator
I want I want the system to automatically block unauthorized users from accessing proxy and bulk registration routes, and to have my own submissions validated against my role at both the navigation and database layers
So that So that peer mentors or users with insufficient permissions cannot register activities on behalf of others, protecting data integrity and preventing unauthorized impersonation
- Given a user with peer_mentor role is authenticated, when they attempt to navigate to the Proxy Registration Screen URL directly, then the navigation guard redirects them to the no-access screen
- Given a coordinator submits a proxy registration, when the Activity Delegation Service processes the request, then it verifies the acting user's role before invoking the insert — if the role check fails, the service returns an authorization error
- Given a coordinator's JWT contains a valid coordinator role claim, when the Supabase RLS policy evaluates the insert, then the policy permits the insert on behalf of the specified peer mentor user_id
- +2 more
As a As a Coordinator
I want I want to open a proxy registration flow for a chosen peer mentor and complete the full activity wizard on their behalf
So that So that peer mentors who are not digitally confident or do not have access to the app are not excluded from the reporting pipeline, and coordinators can maintain a single consolidated system without reverting to paper forms
- Given the coordinator is authenticated, when they navigate to the Proxy Registration Screen, then the screen renders the peer mentor selection widget in single-select mode before the wizard is shown
- Given a peer mentor is selected, when the coordinator proceeds, then the full activity wizard is displayed with all standard fields identical to the peer mentor's own flow
- Given the coordinator completes and submits the wizard, when the Activity Delegation Service processes the request, then the activity record is stored with the peer mentor's user_id as owner and a delegation_grants record links the coordinator's user_id as the acting submitter
- +2 more
As a As a Coordinator
I want I want to select multiple peer mentors, configure a shared activity template, and submit all registrations in a single batch action
So that So that I can register recurring fixed activities (such as weekly group sessions) for many peer mentors in seconds instead of entering each record individually
- Given the coordinator is authenticated with coordinator role, when they navigate to the Bulk Registration Screen, then the screen is accessible and the peer mentor selection widget renders a filterable list of all peer mentors in their scope
- Given multiple peer mentors are selected and a shared activity template is filled in, when the coordinator taps Submit, then the Bulk Registration Service issues a single Supabase RPC call inside a database transaction
- Given the batch is submitted, when all inserts succeed, then each peer mentor row shows a success state in the batch progress widget and a delegation_grants record is created linking the coordinator to each activity
- +2 more