HIGH story-duplicate-activity-detection-peer-mentor-004 8 pts
8
Story Points
High
Priority
Duplicate Activity Detection
Feature

User Story

As a Peer Mentor (Likeperson)
I want the duplicate check to run automatically when I register activities on behalf of one or more peer mentors using proxy or bulk registration
So that I do not accidentally create duplicate records while performing batch registrations for recurring group activities

Audience Summaries

Duplicate data contamination in Bufdir reporting represents a direct financial and compliance risk for the organization. Coordinators running weekly group activities for 20 peer mentors across 52 weeks could inadvertently generate hundreds of erroneous records annually through proxy and bulk registration flows—without detection. This high-priority story closes the most statistically significant source of data quality degradation by extending duplicate detection to cover all registration pathways. Protecting report integrity safeguards funding calculations, preserves the trust of regulatory stakeholders, and demonstrates operational maturity in managing large-scale volunteer data.

The consolidated conflict resolution screen also reduces coordinator friction, improving adoption and satisfaction among the most data-intensive user segment.

This high-priority story builds on the existing individual duplicate detection story (story-duplicate-activity-detection-coordinator-1) and must not be scheduled independently—dependency sequencing is critical. Delivery complexity is moderate-to-high: the bulk validation flow requires per-participant conflict checking before batch commit, a consolidated review UI, and a confirmation screen with resolution counts. Testing scope is broad, covering proxy single-registration paths, bulk submissions with zero, partial, and full conflict sets, recurring template pre-submission highlighting, and coordinator resolution actions (mark distinct vs. skip).

User acceptance testing should involve coordinators who manage high-volume groups to validate the review screen usability. Risk: incomplete conflict resolution UI could lead to data inconsistency; mitigate with strict pre-save gating. Rollout should follow the individual detection feature to shared coordinators first.

This story extends the duplicate detection service to cover two additional registration entry points: proxy (single record, on behalf of another user) and bulk (batch submission for multiple participants). The proxy path should reuse the existing duplicate-warning-dialog component with no interface changes. The bulk path requires a new consolidated review screen that aggregates all per-participant conflicts into a single grouped list before the batch write is committed—no per-conflict interruption dialogs. Implementation steps: (1) refactor duplicate check into a standalone async function accepting a participant ID and activity payload; (2) in the bulk submission controller, run checks in parallel for all participants and collect results; (3) render conflict summary component with approve/skip controls per conflict; (4) on final confirmation, filter the submission array to exclude skipped records; (5) for recurring templates, run pre-submission conflict checks on all template participants and surface highlights before coordinator submits.

Ensure transaction rollback safety if batch partially fails after partial write.

Acceptance Criteria

  • Given a coordinator submits a proxy registration on behalf of a peer mentor, When the submitted activity matches an existing record for that peer mentor, Then a duplicate-warning-dialog appears with the same comparison interface as self-registration
  • Given a coordinator submits a bulk registration for 10 peer mentors, When 3 of the 10 have conflicting existing records, Then a consolidated duplicate summary shows all 3 conflicts grouped in one review screen before the batch is saved
  • Given the consolidated duplicate summary is shown, When the coordinator resolves each conflict (mark distinct or skip), Then only the non-conflicting records plus the explicitly approved duplicates are saved
  • Given a bulk registration is completed with some conflicts skipped, When the coordinator views the confirmation screen, Then it displays a count of successfully saved records and a count of skipped records
  • Given a recurring bulk registration template is applied, When any participant in the template already has an activity within the same date/time window, Then those participants are highlighted before the coordinator submits

Business Value

Coordinators who manage large groups are most exposed to accidental duplicate creation because they submit high volumes of records rapidly. A coordinator running weekly group activities for 20 peer mentors across 52 weeks could inadvertently create hundreds of duplicate entries per year without automated detection. Catching these at bulk submission time eliminates the most statistically likely source of duplicate contamination in Bufdir data.