Annual Summary Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
3
Dependents
1
Entities
0
Integrations
Description
Data access layer for the annual_summaries table. Manages CRUD operations for pre-computed peer mentor annual summary records including all aggregated metrics, slide content payloads, and view/share tracking metadata. Provides efficient lookup by userId and year.
annual-summary-repository
Responsibilities
- Persist and retrieve annual summary records keyed by userId and year
- Track viewed and shared state per summary record
- Support upsert operations for annual aggregation job reruns
- Provide existence check for determining whether summary is cached
Interfaces
findByUserAndYear(userId, year)
upsertSummary(summaryData)
markViewed(summaryId, viewedAt)
markShared(summaryId, platform, sharedAt)
getAvailableYears(userId)
deleteSummary(summaryId)
listAllForYear(year)
existsForUserAndYear(userId, year)
Relationships
Dependents (3)
Components that depend on this component