Badge Service
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Evaluates badge qualification rules against user activity history and triggers awards when milestones are reached. Orchestrates badge checks after activity logging events and computes progress toward locked badges. Coordinates with the Badge Store to persist newly awarded badges.
badge-service
Sources & reasoning
Badges are explicitly mentioned in §2.2 alongside Wrapped and listed by name in the Fase 3 (Growth & Engagement) deliverables, anchoring both scope and target_release.
-
docs/source/likeperson.md · line 47Også nevnt: «Årets koordinator», statusbadges og halvårsoppsummeringer.
-
docs/source/likeperson.md · line 265-266Fase 3 - Vekst og engasjement - Gamification / «Ditt likepersonsår» (Wrapped, badges, Advantage Calculator)
Responsibilities
- Evaluate qualification rules for activity-count milestones (1, 10, 50, 100)
- Detect anniversary and certification-completion badge eligibility
- Award role-specific badges like 'Årets koordinator' based on annual criteria
- Compute progress percentages for locked badges
- Notify UI layer when new badges are awarded
Interfaces
evaluateBadges(userId): BadgeAwardResult[]
getProgress(userId, badgeId): ProgressInfo
checkOnActivityLogged(userId, activityId): void
awardBadge(userId, badgeId): Badge