Service Layer high complexity backend
0
Dependencies
0
Dependents
4
Entities
0
Integrations

Description

Business logic service that detects when a user is about to register an activity that appears to duplicate an existing registration across any of their affiliated organizations. Uses fuzzy matching on activity type, contact, date, and duration with configurable tolerance thresholds, then raises a warning before submission.

Feature: Multi-Organization Membership Handling

duplicate-report-prevention-service

Responsibilities

  • Query existing activity records across all user-affiliated organizations
  • Apply fuzzy-match logic on activity type, contact ID, date, and duration
  • Generate a duplicate risk score and return matched candidates
  • Trigger a duplicate warning event to the UI before save
  • Log deduplication audit events for compliance reporting

Interfaces

checkForDuplicates(activityPayload, userId)
calculateDuplicateScore(candidate, newActivity)
getCandidateActivities(userId, dateRange)
flagAsDuplicate(activityId, duplicateOfId)
getDuplicationAuditLog(organizationId)
setFuzzyMatchThresholds(config)
dismissDuplicateWarning(activityId)

Sub-Components (1)

Fuzzy Match Engine
component medium

Internal sub-component that performs field-level similarity comparisons for duplicate detection using configurable tolerance windows.

  • Compare activity type, contact, date, and duration fields
  • Return similarity score between 0 and 1 for each candidate
  • Support configurable date and duration tolerance windows