high complexity extracted Activity Oversight Confidence: 100%
2
Components
4
Shared
0
User Stories
Yes
Analyzed

Description

The Duplicate Activity Detection feature automatically identifies activity submissions that appear to represent the same real-world interaction registered multiple times, either by the same peer mentor or by a coordinator reporting on behalf of a peer mentor who also submitted independently. The detection engine compares contact reference, date, time window, activity type, and duration using configurable similarity thresholds. High-confidence duplicates are surfaced in the Admin Web Portal via alert widgets and auto-flagged for coordinator review. Administrators can confirm duplicates for suppression or dismiss false positives to calibrate thresholds over time.

Sources & reasoning

Line 107 explicitly names duplicate detection as a concrete NHF requirement tied to multi-coordinator registration scenarios. Blueprint marks this [v1.0], consistent with it being a post-MVP quality enforcement feature building on the approval and flagging infrastructure. The Fase 1 scope does not include it, and the compliance risk to Bufdir reporting justifies high priority within v1.0 once basic oversight is established.

  • docs/source/likeperson.md · line 107
    Duplikatvarsling: Fange opp når samme aktivitet registreres av flere koordinatorer.

Analysis

Business Value

Duplicate activity registration is an explicitly named risk for NHF, where the same activity can be logged by multiple coordinators across its 1,400 local associations. Duplicate entries in Bufdir reporting data could constitute regulatory non-compliance and jeopardize grant eligibility for the entire organization. Manual cross-referencing at NHF scale is not operationally feasible, making automated detection a practical necessity. Beyond compliance, duplicate suppression ensures that statistics, reimbursement calculations, and coordinator dashboards reflect accurate activity counts, which underpins trust in platform data quality across all participating organizations. Early detection also reduces the cost of correction by catching duplicates before they enter approved reporting batches.

Implementation Notes

DuplicateDetectionService runs as a background job triggered on activity submission, executing similarity queries against the PostgreSQL activities table using indexed lookups on contact_id, activity_type_id, and a configurable timestamp window (default plus or minus two hours). Similarity scoring weights attribute matches with per-organization configurable coefficients. Detections above the high-confidence threshold create ActivityFlag records via ActivityFlaggingService with flag_type set to suspected_duplicate and a reference to the candidate duplicate activity_id. DuplicateActivityAlertWidget renders these flags with side-by-side activity comparison in the admin portal. Confirmed duplicates are soft-deleted and excluded from reporting queries via a suppressed boolean on the activities table. False positive dismissals increment a per-pair counter used in threshold calibration.

User Stories

No user stories have been generated for this feature yet.