configuration PK: id 15 required 1 unique

Description

Organization-scoped configuration records that define the assignment count thresholds at which peer mentors qualify for honorarium tiers. Each record specifies a threshold boundary (e.g., 3 assignments triggers base honorarium, 15 triggers higher rate), the monetary amount, the reporting period, and activation status. Blindeforbundet's office honorarium model is the primary driver: coordinators need real-time visibility into which tier each mentor has reached within the current period.

18
Attributes
4
Indexes
9
Validation Rules
12
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the threshold configuration record
PKrequiredunique
organization_id uuid Foreign key to the organization that owns this threshold configuration
required
name string Human-readable label for this threshold tier (e.g., 'Base Honorarium', 'Senior Rate')
required
threshold_count integer Number of completed assignments required to reach this tier within the reporting period
required
honorarium_amount decimal Monetary amount (NOK) awarded when this threshold is reached
required
currency string ISO 4217 currency code for the honorarium amount
required
period_type enum Reporting period over which assignments are counted toward this threshold
required
tier_order integer Sort order defining the progression sequence of tiers within the organization (lower = earlier tier)
required
is_cumulative boolean Whether higher tiers include lower-tier amounts (true) or replace them (false)
required
is_active boolean Whether this threshold configuration is currently active and used for evaluation
required
effective_from datetime Date from which this threshold configuration takes effect
required
effective_until datetime Date until which this threshold configuration is valid; null means no expiry
-
description text Optional explanation of the threshold purpose, payout conditions, or policy reference
-
notification_enabled boolean Whether to trigger a notification when a peer mentor reaches this threshold
required
created_at datetime Timestamp when this configuration record was created
required
updated_at datetime Timestamp when this configuration record was last modified
required
created_by uuid User ID of the administrator who created this configuration
required
updated_by uuid User ID of the administrator who last modified this configuration
-

Database Indexes

idx_threshold_configs_org_id
btree

Columns: organization_id

idx_threshold_configs_org_active
btree

Columns: organization_id, is_active

idx_threshold_configs_org_tier
btree unique

Columns: organization_id, tier_order

idx_threshold_configs_effective_range
btree

Columns: effective_from, effective_until

Validation Rules

threshold_count_positive error

Validation failed

honorarium_amount_non_negative error

Validation failed

valid_organization_reference error

Validation failed

effective_from_required error

Validation failed

effective_until_after_from error

Validation failed

name_not_blank error

Validation failed

valid_period_type_enum error

Validation failed

tier_order_non_negative error

Validation failed

currency_iso_format error

Validation failed

Business Rules

unique_threshold_count_per_org_period
on_create

Within the same organization and period_type, no two active configurations may share the same threshold_count value, preventing ambiguous tier evaluation

ascending_honorarium_with_tier
on_create

Higher tier_order records must have a threshold_count greater than or equal to lower-tier records within the same organization, ensuring logical tier progression

org_admin_only_modification
always

Only Organization Administrators and Global Administrators may create, update, or deactivate threshold configurations; coordinators have read-only access

no_retroactive_effective_date
on_create

The effective_from date of a new configuration must not precede any existing completed reporting period to prevent retroactive honorarium recalculation without explicit admin override

deactivation_over_deletion
on_delete

Threshold configurations that have been used for past period evaluations must be deactivated (is_active = false) rather than deleted, preserving audit history

at_least_one_active_config
on_update

An organization using assignment threshold tracking must have at least one active threshold configuration at all times; deactivating the last config is blocked

threshold_notification_on_reach
always

When a peer mentor's completed assignment count crosses a threshold_count boundary and notification_enabled is true, trigger a push notification to the mentor and their coordinator

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage