Statistics Service
Component Detail
Service Layer
medium complexity
Shared Component
backend
0
Dependencies
2
Dependents
5
Entities
0
Integrations
Description
Shared service that provides aggregated activity and contact statistics for a given user and time range. Used by both the Personal Activity Statistics feature and the Annual Summary aggregation pipeline. Encapsulates queries for total hours, activity counts, contact support counts, and activity type breakdowns.
statistics-service
Responsibilities
- Compute aggregated statistics for a user over a given time range
- Break down statistics by activity type, contact category, and month
- Provide data for both real-time dashboard display and annual batch aggregation
Interfaces
getUserStats(userId, from, to)
getActivityBreakdown(userId, year)
getContactStats(userId, year)
getMonthlyTrend(userId, year)
getActivityTypeDistribution(userId, year)
getTotalHours(userId, year)
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (5)
Data entities managed by this component