Achievement Service
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
6
Entities
0
Integrations
Description
Background service that evaluates badge eligibility after each activity save and after period-end calculations. Supports per-organisation badge configuration so HLF certification-linked badges and Blindeforbundet assignment-count badges coexist without coupling. Emits badge award events to the Push Notification Service when a new badge is unlocked.
achievement-service
Responsibilities
- Evaluate badge eligibility triggers after activity saves
- Run period-end milestone checks for all active users
- Award badges and persist user_badges records
- Emit award events to Push Notification Service
- Support per-organisation badge definition sets
Interfaces
evaluateBadgesForUser(userId, orgId)
checkMilestoneTriggers(activityEvent)
awardBadge(userId, badgeId)
getEarnedBadges(userId)
getLockedBadges(userId)
getBadgeProgress(userId, badgeId)
runPeriodEndEvaluation(orgId, period)
getBadgeCatalogueForOrg(orgId)
Related Data Entities (6)
Data entities managed by this component