Threshold Configuration Service
Component Detail
Service Layer
medium complexity
backend
1
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Manages the lifecycle of threshold configurations per organization, including creation, versioning, activation, and deactivation of honorarium tier rules. Ensures that changes to thresholds produce a new version without mutating historical records, allowing accurate retrospective reporting.
threshold-config-service
Responsibilities
- CRUD operations for organization threshold configurations
- Version threshold configs on every update to preserve historical accuracy
- Validate threshold tier definitions (ascending counts, non-overlapping ranges)
- Expose active configuration snapshot for a given organization and reporting period
Interfaces
getActiveConfig(orgId: String): ThresholdConfig
getConfigVersion(orgId: String, version: String): ThresholdConfig
createConfig(orgId: String, tiers: ThresholdTier[]): ThresholdConfig
updateConfig(orgId: String, tiers: ThresholdTier[]): ThresholdConfig
listConfigVersions(orgId: String): ThresholdConfigVersion[]
validateTierDefinitions(tiers: ThresholdTier[]): ValidationResult
deactivateConfig(orgId: String, configId: String)
Relationships
Related Data Entities (2)
Data entities managed by this component