medium complexity extracted Encrypted Data Assignments Confidence: 100%
5
Components
39
Shared
0
User Stories
Yes
Analyzed

Description

Assignment Threshold Tracking monitors the cumulative count of completed assignments per peer mentor and surfaces milestone events that trigger organizational actions such as honorarium payments or tier upgrades. The primary driver is Norges Blindeforbund's model where a contact honorarium is awarded at the 3rd completed assignment and a higher rate applies from the 15th onward. The feature provides a dashboard widget visible to coordinators showing each peer mentor's current assignment count, their distance from the next threshold, and a history of milestone events. The system must automatically detect when a threshold is crossed on assignment completion and notify both the peer mentor (positive reinforcement) and the coordinator (administrative action required). Threshold rules are configurable per organization via the admin portal so that different organizations can define their own milestone structures without code changes. The feature integrates with the assignment status tracking table to derive counts from confirmed-read assignments rather than merely dispatched ones.

Analysis

Business Value

Threshold tracking automates a manual administrative process that coordinators currently perform by counting rows in spreadsheets or membership systems. Errors in this process directly translate to incorrect honorarium payments, which erodes trust with peer mentors and creates financial reconciliation work. By deriving counts from confirmed-read assignments stored in the platform, the feature provides an auditable, tamper-evident record that satisfies Bufdir reporting requirements and simplifies year-end accounting. For peer mentors, milestone notifications provide meaningful recognition at the moment of achievement rather than in a delayed annual summary. This contributes to retention and motivation, which is a stated concern across multiple workshop organizations. The configurable threshold model means the feature delivers value to any organization with a milestone-based honorarium or recognition structure, extending its commercial relevance beyond Blindeforbundet's specific rules.

Implementation Notes

Threshold rules should be stored as a JSON configuration per organization in the module_configurations table, keyed to the encrypted-assignments module. Each rule specifies a count, a label (e.g. "Contact honorarium"), and an action type (notify_coordinator, notify_mentor, or both). The count is derived by querying assignment_reads joined to assignments for confirmed reads by a given user, scoped to the organization. On the Flutter side, the coordinator home screen or a dedicated dashboard widget fetches a paginated list of mentors with their current counts and next-threshold distances. The widget should use color-coded progress indicators consistent with the design token system. Server-side threshold evaluation runs in the assignment-completion handler: after persisting a read receipt, query the updated count and evaluate against the organization's rule set. Matching thresholds enqueue push notifications and create an audit log entry. Avoid re-triggering on duplicate read events by checking whether the milestone record already exists before inserting. All threshold logic must be unit-tested with parameterized rule sets covering edge cases such as the threshold count being reached by a retroactive import.

Components (44)

User Interface (1)

Service Layer (2)

Data Layer (1)

Infrastructure (1)

Shared Components

These components are reused across multiple features

User Stories

No user stories have been generated for this feature yet.