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

Description

Business logic layer that computes and assembles a user's annual summary from raw activity data. It coordinates with the repository to retrieve persisted summaries or triggers on-demand calculation when none exists. The service formats results into structured slide data ready for the animation widget.

Feature: Annual Summary (Wrapped)

annual-summary-service

Sources & reasoning

Lines 76 and 353 confirm three organizations explicitly requested a Spotify Wrapped-style year-in-review. The priority matrix (line 149) classifies it NICE TO HAVE in Fase 3, mapping to v1.1. The feature directly addresses the stated goal of making volunteer effort visible and motivating continued engagement.

  • Tre organisasjoner er inspirert av Spotify Wrapped og ønsker en funksjon som viser likepersonens bidrag over tid - «Din likepersonsĂĄrek».
  • | Gamification / Spotify Wrapped | âś“ | âś“ | - | âś“ | âś“ | NICE TO HAVE | 3 |
  • - Gamification / «Ditt likepersonsĂĄr» (Wrapped, badges, Advantage Calculator)

Responsibilities

  • Retrieve or compute annual statistics for a given user and year
  • Aggregate activity counts, contact tallies, and milestone achievements into a summary model
  • Transform summary data into ordered slide definitions for the animation widget
  • Cache computed summaries to avoid redundant recalculation across sessions

Interfaces

getAnnualSummary(userId: string, year: number): Promise<AnnualSummary>
buildSlides(summary: AnnualSummary): SummarySlide[]
invalidateCache(userId: string, year: number): void

Related Data Entities (3)

Data entities managed by this component