Service Layer medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Backend service that executes the advantage calculation formula using mentor activity inputs and organization-specific multipliers. Returns a structured result expressing volunteer contribution as monetary or societal value.

Feature: Advantage Calculator

calculation-service

Sources & reasoning

Source explicitly relocates Advantage Calculator from speculative Fase 4 to Fase 3 inside Achievements & Gamification, making Growth & Engagement the correct target_release.

  • docs/source/likeperson.md · line 275-276
    Ingen bekreftede Fase 4-leveranser. Fordelskalkulator (Advantage Calculator) ligger inne i Achievements & Gamification-området og følger derfor Fase 3.
  • docs/source/likeperson.md · line 265-266
    Fase 3 - Vekst og engasjement - Gamification / «Ditt likepersonsår» (Wrapped, badges, Advantage Calculator)

Responsibilities

  • Apply the advantage formula to hours, kilometers, and activity counts
  • Resolve organization-specific multipliers for the requesting mentor
  • Aggregate activity history into calculation inputs when not provided
  • Return structured results suitable for visual presentation
  • Validate inputs and guard against missing or malformed activity data

Interfaces

calculateAdvantage(userId, inputs): CalculationResult
getMultipliersForOrganization(orgId): Multipliers
buildInputsFromHistory(userId): CalculatorInputs