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

Description

Backend service that orchestrates synchronization between Meander activity records and external calendar applications. It handles OAuth token management, translates activity records into iCal-compatible events, and manages conflict detection and resolution.

Feature: Calendar Sync

calendar-sync-service

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 116
    Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.

Responsibilities

  • Manage OAuth2 token lifecycle for connected calendar providers
  • Convert Meander activity records into calendar event objects (iCal/RFC 5545)
  • Push new and updated activities to external calendars via provider APIs
  • Poll or receive webhooks from external calendars to detect conflicts
  • Persist sync state and retry failed sync operations with backoff

Interfaces

syncActivity(activityId: string, userId: string): SyncResult
syncAllPending(userId: string): BatchSyncResult
revokeCalendarAccess(userId: string, provider: CalendarProvider): void
handleWebhookEvent(payload: WebhookPayload): void
getCalendarSyncStatus(userId: string): SyncStatus
resolveConflict(conflictId: string, resolution: ConflictResolution): void

Related Data Entities (1)

Data entities managed by this component