Coordinator Activity Approval & Correction
Feature Detail
Description
This feature enables coordinators to review, approve, correct, and override activity registrations submitted by peer mentors within their organizational scope. The approval queue surfaces registrations that require attestation — particularly travel expense claims above auto-approval thresholds — as well as flagged duplicates and registrations submitted on behalf of others. Coordinators can edit registration details, add correction notes, reject invalid entries, and approve batches in bulk, maintaining data quality for Bufdir reporting and reimbursement processing.
Analysis
Data quality in activity registration is critical for Bufdir grant compliance — inaccurate or duplicate registrations can jeopardize funding and trigger audits. Coordinators currently spend significant time manually reconciling Word forms and Excel aggregations, a process that is both error-prone and unsustainable at scale. Providing a structured approval and correction workflow eliminates this bottleneck, gives coordinators clear accountability for what gets reported, and creates an auditable trail of changes. For NHF with 1,400 local associations and HLF's strict expense validation rules, the ability to override and correct registrations without deleting them preserves historical integrity while still ensuring reportable data is accurate. This feature is also a prerequisite for coordinator proxy reporting to function reliably at scale.
The approval queue screen fetches pending registrations from Supabase filtered by the coordinator's organizational scope and ordered by submission date. The correction request widget uses a modal or inline edit pattern allowing field-level edits with a mandatory correction reason field for audit trail purposes. The Activity Approval Service handles state transitions (pending → approved/rejected/corrected) and triggers downstream effects such as reimbursement workflow initiation or duplicate flagging suppression. Bulk approval should be implemented as a multi-select list action with a confirmation dialog. Integration with the Duplicate Detection Service means flagged duplicates appear in the queue with contextual warnings. All state changes must be persisted transactionally in Supabase to avoid partial approvals. BLoC pattern is recommended for queue state management given the complex multi-step interaction model.
Dependencies
Definition of Done
User Stories (9)
As a As a user
I want I want to view the complete correction and approval history for any activity registration, including who made each change, what was changed, when, and the documented reason
So that So that I have a transparent, immutable record of every state transition and correction that can be referenced during Bufdir audits, internal reviews, or when a peer mentor queries the outcome of their submission
- Given a coordinator opens any registration detail within their organizational scope, when they navigate to the audit trail section, then a chronological timeline of all state changes is displayed with actor identity, timestamp, changed fields, and documented reasons
- Given a correction was made, when the audit trail entry for that correction is displayed, then both the original field values and the corrected values are shown alongside the mandatory correction reason
- Given an organization administrator views the audit trail for a registration, when the trail includes changes made by any coordinator in their organization, then all changes are visible regardless of which coordinator made them
- +2 more
As a As a user
I want I want to view the complete correction and approval history for any activity registration, including who made each change, what was changed, when, and the documented reason
So that So that I have a transparent, immutable record of every state transition and correction that can be referenced during Bufdir audits, internal reviews, or when a peer mentor queries the outcome of their submission
- Given a coordinator opens any registration detail within their organizational scope, when they navigate to the audit trail section, then a chronological timeline of all state changes is displayed with actor identity, timestamp, changed fields, and documented reasons
- Given a correction was made, when the audit trail entry for that correction is displayed, then both the original field values and the corrected values are shown alongside the mandatory correction reason
- Given an organization administrator views the audit trail for a registration, when the trail includes changes made by any coordinator in their organization, then all changes are visible regardless of which coordinator made them
- +2 more
As a As a Coordinator
I want I want to reject an activity registration that cannot be corrected or approved, providing a mandatory documented reason, optionally notifying the original submitter
So that So that invalid registrations are removed from the active reporting pipeline while retaining a documented record of why they were rejected, enabling the submitter to understand what went wrong and resubmit correctly if applicable
- Given a coordinator taps 'Reject' on a pending registration, when the dialog opens, then the Rejection Reason Dialog is displayed with a mandatory text field and an optional 'Notify submitter' toggle
- Given the rejection dialog is open, when the coordinator attempts to confirm rejection without entering a reason, then the confirm button remains disabled and a validation hint is displayed
- Given the coordinator submits a rejection with a reason, when the transaction completes, then the registration status is set to 'rejected' and the reason, coordinator identity, and timestamp are stored in the audit record
- +3 more
As a As a Coordinator
I want I want to select multiple pending registrations from the queue and approve them in a single batch action with a confirmation summary before committing
So that So that I can efficiently clear routine low-risk registrations without approving each one individually, reducing time spent on repetitive approval actions during high-volume periods
- Given the coordinator is in the approval queue, when they enter multi-select mode, then each list item shows a checkbox and a bulk action bar appears at the bottom of the screen
- Given items are selected for bulk approval, when the coordinator taps 'Approve Selected', then the Bulk Approval Confirmation Widget displays a count breakdown by registration type and total expense value before any changes are committed
- Given the confirmation dialog shows items excluded from bulk approval due to flags, when the coordinator reviews the list, then excluded items are clearly identified with their flag reason
- +3 more
As a As a Coordinator
I want I want to see duplicate-flagged registrations in the approval queue with contextual comparison information showing what the suspected duplicate is, so I can make an informed decision to approve the unique one and reject the duplicate
So that So that Bufdir reporting data does not contain double-counted activities — which would misrepresent the organization's activity volume and jeopardize grant compliance
- Given a registration has been flagged as a potential duplicate, when it appears in the approval queue, then a distinct duplicate warning badge is displayed on the queue item
- Given the coordinator opens a duplicate-flagged registration, when the detail view loads, then a side-by-side comparison panel shows the suspected duplicate record with key fields highlighted for comparison
- Given the coordinator determines the records are legitimately distinct, when they approve with duplicate flag suppression, then both records proceed independently and the duplicate flag is cleared from the current registration's audit record
- +2 more
As a As a Organization Administrator
I want I want to configure the auto-approval thresholds, mandatory review triggers, and approval workflow rules that govern how activity registrations are processed within my organization
So that So that the approval workflow reflects my organization's specific compliance rules — for example, HLF's rule that expense claims above 50 km or with receipts over 100 NOK require manual coordinator attestation while routine low-value registrations are auto-approved
- Given an organization administrator navigates to approval workflow settings, when the settings screen loads, then all current threshold values and toggle states are displayed with their last-modified timestamps
- Given the administrator updates the mileage auto-approval threshold, when they save the new value, then the change is persisted with the administrator's identity and timestamp in a versioned configuration record
- Given the threshold configuration is updated, when a new expense registration is submitted after the change, then the Activity Approval Service applies the new threshold to determine whether the registration is auto-approved or placed in the pending queue
- +2 more
As a As a Coordinator
I want I want to review the full details of a pending activity registration and approve it with a single action, triggering the appropriate downstream workflows
So that So that the registration is confirmed for Bufdir reporting and, where applicable, the reimbursement processing workflow is initiated without requiring additional manual steps
- Given a coordinator opens a pending registration, when they tap 'Approve', then the activity status transitions to 'approved' atomically in Supabase and an approval history record is inserted in the same transaction
- Given the approved registration includes a travel expense claim, when approval is confirmed, then the reimbursement workflow is automatically initiated
- Given approval succeeds, when the state transition completes, then the registration is removed from the pending queue and the coordinator is returned to the queue with a success confirmation
- +2 more
As a As a Coordinator
I want I want to see all pending activity registrations within my organizational scope in a prioritized queue, filterable by submission date, registration type, and warning flags
So that So that I can efficiently triage which registrations require immediate attention and process them in a structured order without missing any pending items
- Given a coordinator is authenticated and has organizational scope assigned, when they navigate to the approval queue, then they see only registrations belonging to peer mentors within their organizational hierarchy
- Given pending registrations exist, when the queue loads, then items are ordered by submission date (oldest first) by default
- Given a registration has a duplicate flag or exceeds the expense auto-approval threshold, when it appears in the queue, then the relevant warning badge is prominently displayed on the list item
- +2 more
As a As a Coordinator
I want I want to edit specific fields of a submitted activity registration while providing a mandatory correction reason, without deleting the original record
So that So that inaccurate registrations can be fixed for Bufdir reporting accuracy while maintaining a complete, immutable audit trail of every change for compliance and accountability purposes
- Given a coordinator opens a pending or flagged registration, when they tap 'Correct', then the Correction Request Widget opens with all editable fields pre-populated with current values
- Given the correction widget is open, when the coordinator modifies any field, then the 'Save Correction' button remains disabled until the mandatory Correction Reason field contains at least 10 characters
- Given the coordinator submits a correction, when the Correction Validation Service detects a constraint violation (e.g., duration exceeds maximum for activity type), then an inline validation error is shown and save is blocked
- +3 more