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

Description

Backend service that queries assignment_status_logs for completed-status assignments per peer mentor, evaluates counts against organisation-specific thresholds retrieved from AssignmentThresholdsRepository, emits threshold-crossing events, triggers push notifications, and writes honorarium log entries. Exposes a read endpoint consumed by the Flutter app and the admin portal.

Feature: Assignment Threshold Tracking

threshold-tracking-service

Responsibilities

  • Count completed assignments per peer mentor by querying assignment_status_logs
  • Load organisation threshold configuration from AssignmentThresholdsRepository
  • Detect when a count crosses a configured threshold boundary
  • Emit threshold events that trigger notifications and honorarium log writes
  • Expose REST read endpoint GET /api/v1/assignments/threshold-status

Interfaces

ThresholdStatus getThresholdStatus(String userId, String orgId)
List<MentorThresholdSummary> getOrgThresholdOverview(String orgId)
void evaluateAndEmitThresholdEvents(String userId, String orgId)
GET /api/v1/assignments/threshold-status
GET /api/v1/assignments/threshold-overview

Relationships

Dependencies (2)

Components this component depends on

Dependents (2)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component