Duplicate Activity Detection
Feature Detail
Description
This feature detects and warns users when an activity being registered appears to be a duplicate of one already in the system. The detection logic checks for matching combinations of peer mentor, contact, date, and activity type, surfacing a clear warning before the user saves. This prevents double-counting in statistics and Bufdir reports, which is particularly important in NHF's multi-coordinator environment where the same group activity may be registered by several people independently. The warning is non-blocking — users can override it if the activity is genuinely distinct.
User Flow
Analysis
Duplicate activity registrations directly undermine the accuracy of statistics, coordinator reports, and Bufdir submissions, creating legal and financial risk for organizations that receive grant funding based on reported activity counts. NHF explicitly identified duplicate detection as a unique requirement given their complex structure of 12 national associations, 9 regions, and 1,400 local associations where the same group event can easily be reported by multiple coordinators. A false Bufdir report — even if unintentional — could jeopardize future funding. By proactively surfacing potential duplicates at registration time, this feature protects data integrity without blocking legitimate work, striking the right balance between data quality and usability for volunteers who may not be aware of parallel registrations.
Duplicate detection is implemented as a lightweight API check triggered client-side when the user reaches the summary step of the activity wizard, before final submission. The backend query checks the activities table for existing records matching the same peer_mentor_id, contact_id (if provided), activity_date (same day), and activity_type_id within the same local_association_id scope. A fuzzy window of ±1 day should be configurable. The Next.js API returns a boolean flag and optionally the conflicting activity ID for display. On the Flutter side, a non-blocking warning widget (DuplicateWarningWidget) appears inline in the wizard summary step with a clear explanation and two options: go back to edit, or confirm and save anyway. The check adds minimal latency and must not block the save path. All duplicate detections are logged for coordinator audit review.
Components (62)
Shared Components
These components are reused across multiple features
User Interface (16)
Service Layer (13)
Data Layer (9)
Infrastructure (20)
User Stories
No user stories have been generated for this feature yet.