CRITICAL story-duplicate-activity-detection-organization-administrator-001 5 pts
5
Story Points
Critical
Priority
Duplicate Activity Detection
Feature

User Story

As a user
I want to be warned when an activity I am about to submit appears to be a duplicate of one already recorded for the same peer mentor
So that So that I can make an informed decision before finalizing the registration, preventing double-counting in Bufdir reports and statistical records

Acceptance Criteria

  • Given a user is submitting an activity, when the system finds an existing activity for the same peer mentor on the same day with the same activity type, then the Duplicate Warning Dialog is shown before saving
  • Given the duplicate check runs, when primary signals (user_id, activity_date, activity_type_id) match and secondary signals (duration within 15 min, contact_id) also match, then a high-confidence duplicate warning is displayed
  • Given the Duplicate Warning Dialog is shown, when it renders, then it displays the conflicting existing record's date, duration, contact name, and activity type alongside the candidate record's details
  • Given the duplicate check runs, when no match exceeds the confidence threshold, then the activity is saved without any warning dialog appearing
  • Given the duplicate check is in progress, when the check completes, then the submission flow is not blocked for more than 2 seconds under normal conditions

Business Value

NHF explicitly identified duplicate activity registration as a compliance and financial risk: the same activity being recorded by multiple coordinators inflates Bufdir statistics, which can lead to grant clawback, audit findings, or reputational damage. Proactive detection at the point of entry prevents data quality problems before they compound into costly corrections in regulatory reporting contexts.