Detect and Resolve Duplicate Activities During Proxy Registration
Since both peer mentors and coordinators may register the same activity independently (e.g., a mentor self-registers a session and then a coordinator also registers it), the system must detect potential duplicates before saving. When the coordinator submits a proxy registration that closely matches an existing record for that mentor (same date, same activity type, similar duration), the system presents a duplicate warning dialog showing both records side by side. The coordinator can then choose to cancel, proceed anyway with a justification note, or delete the existing record and replace it.
User Story
Acceptance Criteria
- Given a peer mentor already has an activity registered for today of type 'Individual follow-up', when a coordinator registers the same type for the same mentor on the same date, then a duplicate warning dialog appears before saving
- Given the duplicate warning dialog is shown, when I view it, then I can see both the existing record and the new record side by side with all relevant fields
- Given the duplicate warning dialog is shown, when I choose 'Cancel', then the form stays open and no record is created
- Given the duplicate warning dialog is shown, when I choose 'Register anyway', then both records are saved and an audit note is attached to the new record indicating it was a confirmed duplicate override
- Given bulk registration with 10 mentors where 3 already have matching records, when I proceed, then the system warns me about the 3 duplicates before performing the batch insert for the remaining 7
- Given I confirm a duplicate override, when the record is saved, then the proxy audit logger records the coordinator's decision and timestamp for compliance review
Business Value
Duplicate activity records directly undermine the credibility of Bufdir reports, which are used to justify grant funding. NHF specifically flagged duplicate registration as a risk when multiple coordinators manage overlapping rosters. By catching duplicates at the point of entry — before they pollute the database — the system protects the accuracy of all downstream reporting and prevents coordinators from inadvertently committing reporting errors that could trigger funding audits.
Components
- Proxy Duplicate Detector service
- Duplicate Warning Bottom Sheet ui
- Duplicate Comparison Panel ui
- Duplicate Detection Service service
- Duplicate Resolution Handler service
- Duplicate Check Repository data
- Duplicate Detection BLoC infrastructure
- Duplicate Activity Warning Dialog ui
- Proxy Duplicate Detection Service service
- Proxy Audit Logger infrastructure
- Bulk Registration Service service
- Bulk Registration Service service
- Proxy Activity Data Models data