CalendarEventRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Data access layer responsible for persisting calendar sync metadata, including linked event IDs from external providers and sync state per activity. It provides the queries needed to track which activities have been synced and to resume interrupted sync operations.
calendar-event-repository
Sources & reasoning
Line 116 explicitly names calendar synchronization as part of HLF's peer mentor follow-up improvement plan alongside push notifications, motivated by 40% follow-up dissatisfaction. Blueprint assigns [v1.0] matching Fase 2 positioning in the roadmap.
-
docs/source/likeperson.md · line 116Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.
Responsibilities
- Store mappings between Meander activity IDs and external calendar event IDs
- Track sync status (pending, synced, failed, conflict) per activity per user
- Retrieve all unsynced or failed activities for retry processing
- Record OAuth tokens and provider connection metadata per user
- Support cleanup of stale sync records when a calendar is disconnected
Interfaces
saveEventMapping(activityId: string, externalEventId: string, provider: string): void
getEventMapping(activityId: string, userId: string): CalendarEventMapping | null
listPendingSyncs(userId: string): SyncRecord[]
updateSyncStatus(activityId: string, status: SyncStatus, error?: string): void
saveOAuthToken(userId: string, provider: string, token: OAuthToken): void
deleteUserCalendarData(userId: string, provider: string): void