AssignmentThresholdService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
4
Entities
0
Integrations
Description
A backend service that tracks and evaluates cumulative confirmed assignment counts per peer mentor within a regional coordinator scope. It detects when a mentor's count crosses the 3rd or 15th threshold and emits honorarium trigger events for the compensation workflow.
assignment-threshold-service
Sources & reasoning
Line 96 explicitly defines the two honorarium thresholds (3rd and 15th assignment) per RK, which requires a tracked counter tied to assignment completion. Line 153 places the parent area in Fase 2 (v1.0). This sub-feature must ship alongside encrypted-assignment-dispatch because the threshold cannot be tracked without confirmed assignments.
-
docs/source/likeperson.md · line 96Telling av oppdrag per RK: Kontorhonorar utløses ved 3. oppdrag, høyere sats ved 15.
-
docs/source/likeperson.md · line 153Kryptert oppdragshåndtering | - | - | ✓ | - | ✓ | MUST (Blindeforbundet) | 2
Responsibilities
- Maintain a running confirmed-assignment counter per mentor scoped to their RK region
- Evaluate threshold crossings (3 and 15) upon each assignment confirmation event
- Emit honorarium trigger events when a threshold is reached
- Expose query endpoints for current counts and threshold history per mentor
- Validate that only assignments in confirmed state contribute to the counter
Interfaces
getThresholdSummary(rkScopeId: string): ThresholdSummaryList
getMentorCount(mentorId: string): MentorThresholdEntry
onAssignmentConfirmed(assignmentId: string): ThresholdEvaluationResult
getThresholdHistory(mentorId: string): ThresholdEvent[]
Related Data Entities (4)
Data entities managed by this component