AdvantageCalculatorService
Component Detail
Service Layer
medium complexity
frontend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Computes estimated personal and social impact metrics by processing logged activity data from the personal-activity-statistics feature. It applies calculation models to translate raw volunteer hours and contact counts into concrete advantage indicators. Results are returned in a structured format ready for display and sharing.
advantage-calculator-service
Sources & reasoning
Line 353 lists Advantage Calculator within Fase 3 gamification deliverables. Line 365 explicitly confirms it belongs to Achievements & Gamification and follows Fase 3, mapping to v1.1. The feature translates volunteer effort into tangible impact metrics, supporting the platform's core motivation mission across all four partner organizations.
-
docs/source/likeperson.md · line 353- Gamification / «Ditt likepersonsår» (Wrapped, badges, Advantage Calculator)
-
docs/source/likeperson.md · line 365Fordelskalkulator (Advantage Calculator) ligger inne i Achievements & Gamification-området og følger derfor Fase 3.
Responsibilities
- Retrieve aggregated activity data from the personal-activity-statistics data source
- Apply impact calculation models to produce advantage estimates
- Format results into structured AdvantageResult objects for the UI layer
- Expose calculation logic as a reusable API for future reporting or export features
Interfaces
calculateAdvantages(mentorId: string): Promise<AdvantageResult>
getActivitySummary(mentorId: string): Promise<ActivitySummary>
formatResultForShare(result: AdvantageResult): string