Annual Summary Aggregation Job
Component Detail
Service Layer
high complexity
backend
2
Dependencies
2
Dependents
7
Entities
0
Integrations
Description
Backend scheduled job that runs once per year (January) to pre-compute annual summary data for all active peer mentors. Queries all activity records, contact interactions, hours, and computed statistics for the prior calendar year per user. Results are cached in the database to ensure instant in-app loading. Sends push notification triggers upon completion.
annual-summary-aggregation-job
Responsibilities
- Aggregate all activity records per peer mentor for the prior calendar year
- Compute impact metrics: total hours, contacts supported, activity count, streaks, and org-level percentiles
- Persist computed summaries to annual_summaries table
- Emit push notification trigger events upon completion
Interfaces
runAnnualAggregation(year)
aggregateUserSummary(userId, year)
computeImpactMetrics(activities, contacts)
computePercentileRanking(userId, year)
persistSummary(summaryData)
triggerSummaryReadyNotifications(year)
getJobStatus(year)
Relationships
Dependencies (2)
Components this component depends on
Dependents (2)
Components that depend on this component
Related Data Entities (7)
Data entities managed by this component