StatisticsRepository
Component Detail
Data Layer
medium complexity
mobile
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Provides read access to activity records stored in the local Drift SQLite database for statistics computation. Executes filtered queries by mentor ID and date range and returns structured result sets to StatisticsService. Does not perform any aggregation itself - raw records only.
statistics-repository
Sources & reasoning
Line 321 explicitly places per-peer-mentor statistics in Fase 1 (MVP). The workshop narrative (lines 16-18) confirms that making contribution visible is universally valued. The blueprint tags this feature [MVP]. Fase 1 maps to target_release "MVP" by ordinal position.
-
docs/source/likeperson.md · line 321Enkel statistikkvisning per likeperson og per koordinator
-
docs/source/likeperson.md · line 16-18Alle fire organisasjoner peker på dette som den aller viktigste funksjonen, og beskriver dagens situasjon som uholdbar.
Responsibilities
- Query activity records from Drift database filtered by mentorId and date range
- Return paginated or full record sets suitable for aggregation upstream
- Map Drift table rows to domain ActivityRecord models
- Support efficient date-range queries via indexed timestamp columns
Interfaces
getActivitiesByMentor(mentorId: String, from: DateTime, to: DateTime): Future<List<ActivityRecord>>
getAllActivitiesByMentor(mentorId: String): Future<List<ActivityRecord>>
getActivityCountByType(mentorId: String, from: DateTime, to: DateTime): Future<Map<String, int>>
Related Data Entities (2)
Data entities managed by this component