configuration PK: id 8 required 1 unique

Description

Per-organization configuration defining the cumulative assignment count thresholds that trigger honorarium rate changes and coordinator notifications for peer mentors handling encrypted assignments.

10
Attributes
3
Indexes
4
Validation Rules
6
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
organization_id uuid Foreign key to the organization this threshold configuration belongs to
required
threshold_level integer The assignment count at which this threshold triggers (e.g. 3 for office honorarium, 15 for higher rate)
required
label string Human-readable label for this threshold level (e.g. 'Office honorarium', 'Senior rate')
required
honorarium_rate decimal The honorarium rate (in NOK) that applies once this threshold is reached
-
notify_coordinator boolean Whether reaching this threshold should trigger a coordinator notification
required
notification_message text Optional custom message to include in the coordinator notification when threshold is reached
-
is_active boolean Whether this threshold rule is currently active for the organization
required
created_at datetime Timestamp when this threshold was configured
required
updated_at datetime Timestamp of last update to this threshold configuration
required

Database Indexes

idx_assignment_thresholds_organization_id
btree

Columns: organization_id

idx_assignment_thresholds_org_level
btree unique

Columns: organization_id, threshold_level

idx_assignment_thresholds_active
btree

Columns: organization_id, is_active

Validation Rules

threshold_level_positive error

Validation failed

honorarium_rate_non_negative error

Validation failed

label_required_and_non_empty error

Validation failed

organization_must_exist error

Validation failed

Business Rules

unique_threshold_per_org
on_create

Each organization may only have one threshold configuration per threshold_level value. Duplicate levels within the same org are not permitted.

coordinator_notified_on_threshold_reached
always

When a peer mentor's cumulative assignment count reaches a configured threshold level with notify_coordinator=true, the coordinator must receive a notification via the notification system.

threshold_applies_per_peer_mentor
always

Threshold counting is tracked per peer mentor per organization. Each peer mentor's assignment count is evaluated independently against the org's thresholds.

only_active_thresholds_evaluated
always

Only thresholds with is_active=true are evaluated when checking a peer mentor's assignment count. Inactive thresholds are ignored at runtime.

Storage Configuration

Storage Type
lookup_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage