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

Description

Tracks the cumulative assignment count per peer mentor within a reporting period and evaluates tier transitions against defined volume thresholds. It applies the correct honorarium rate automatically when a mentor crosses the 3rd or 15th assignment boundary. The service exposes count queries and threshold-check operations used by both the UI widget and the reimbursement calculation pipeline.

Feature: Assignment Threshold Tracking

assignment-threshold-service

Sources & reasoning

Line 96 explicitly describes Blindeforbundet's honorarium threshold model where the 3rd and 15th assignments each trigger a rate change. This is a unique financial compliance requirement within the encrypted assignments area. Phase 2 context from the priority matrix (line 153, column value 2) maps to target_release v1.0.

  • - **Telling av oppdrag per RK:** Kontorhonorar utløses ved 3. oppdrag, høyere sats ved 15.

Responsibilities

  • Increment and persist the per-mentor assignment counter on each completed assignment
  • Evaluate whether a new count crosses a tier threshold and trigger tier-change events
  • Return the current count and active tier for a given mentor and reporting period
  • Provide the applicable honorarium rate for a mentor based on their active tier
  • Reset or archive counters at the close of a reporting period

Interfaces

incrementCount(mentorId: string, periodId: string): AssignmentCountResult
getCurrentTier(mentorId: string, periodId: string): HonorariumTier
getCount(mentorId: string, periodId: string): number
getHonorariumRate(tier: HonorariumTier): number
closePeriod(periodId: string): void

Related Data Entities (3)

Data entities managed by this component