Service Layer medium complexity backend
0
Dependencies
1
Dependents
8
Entities
0
Integrations

Description

Backend service managing the full lifecycle of activity flags including creation, resolution, and automated duplicate detection. Handles flag state transitions, enforces role-based permissions for resolution actions, excludes flagged activities from Bufdir report counts and reimbursement queues, and writes all flag events to the audit log.

Feature: Activity Flagging

activity-flagging-service

Responsibilities

  • Create and store flags with reason, flagger identity, and timestamp
  • Process flag resolutions (accept-as-is, correct-and-approve, reject) with role validation
  • Run automated duplicate detection on activity insert comparing contact, date, and type within configurable time window
  • Exclude flagged activities from Bufdir report aggregation and reimbursement queues
  • Write all flag create and resolve events to audit_logs

Interfaces

flagActivity(activityId, reason, flaggedBy)
resolveFlag(flagId, resolution, resolvedBy, notes)
getFlaggedActivities(filters, pagination)
getFlagDetails(flagId)
detectDuplicates(activityId)
runDuplicateDetectionJob(localAssociationId, timeWindowDays)
isFlagged(activityId)
getFlagHistory(activityId)
getAutoFlagConfig(organizationId)
updateAutoFlagConfig(organizationId, config)

Relationships

Dependents (1)

Components that depend on this component