Service Layer medium complexity backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Backend service responsible for creating, updating, and resolving concern flags on activity submissions. It enforces authorization rules so only administrators and coordinators may flag records, and records full actor metadata on every flag lifecycle event. The service exposes a filtered view of flagged activities and ensures audit trail completeness across all flag operations.

Feature: Activity Flagging

activity-flagging-service

Sources & reasoning

Line 195 references corrections as part of the admin oversight mandate, and line 109 establishes NHF's structural complexity as a scaling challenge that binary approval alone cannot address. Blueprint marks this [v1.0] - an enhancement to the MVP approval workflow rather than a launch prerequisite. No explicit Fase 2 mention of flagging, but it naturally extends the oversight capability confirmed by the source and is prerequisite for duplicate detection integration.

  • docs/source/likeperson.md · line 195
    Activity oversight, approval workflows, and corrections
  • docs/source/likeperson.md · line 109
    Bredest organisasjonsstruktur: 12 landsforeninger, 9 regioner, 1 400 lokallag - aktivitetsfordeling mellom ledd må støttes.

Responsibilities

  • Create new flags with type, optional note, and actor metadata
  • Validate actor authorization before allowing flag creation or resolution
  • Persist flag resolution and dismissal events with timestamps and actor identity
  • Provide filtered queries returning all currently open or resolved flagged activities
  • Integrate with activity-review-approval to prevent conflicting state transitions

Interfaces

createFlag(activityId: string, type: FlagType, note?: string, actorId: string): Promise<ActivityFlag>
resolveFlag(flagId: string, resolution: FlagResolution, actorId: string): Promise<ActivityFlag>
dismissFlag(flagId: string, actorId: string): Promise<ActivityFlag>
getFlaggedActivities(filters: FlagQueryFilters): Promise<ActivityFlag[]>
getFlagHistory(activityId: string): Promise<ActivityFlag[]>

Related Data Entities (2)

Data entities managed by this component