Data Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Data access layer that queries the activity and user tables to produce raw datasets for team report generation. It encapsulates all SQL aggregation logic, joining activity logs with user and team records to return typed result sets. Provides the persistence interface used exclusively by TeamReportService.

Feature: Team Reports

report-repository

Sources & reasoning

Line 326 places activity oversight and basic statistics in the Admin MVP scope. Line 195 lists coordinator and org-level dashboards as a core admin portal capability. Team Reports is the direct realization of these requirements. Blueprint assigns MVP, consistent with the Phase 1 admin scope in the source doc.

  • docs/source/likeperson.md · line 326
    Aktivitetsoversikt og grunnleggende statistikk
  • docs/source/likeperson.md · line 195
    Coordinator and organization-level dashboards and KPIs

Responsibilities

  • Query and join activity logs, users, and team assignments for a given scope and period
  • Execute aggregation queries for activity counts, totals, and participation metrics
  • Return typed result sets for service-layer processing
  • Support pagination and cursor-based iteration for large team datasets

Interfaces

fetchActivitiesByTeam(teamId: string, dateRange: DateRange): ActivityRecord[]
aggregateByMentor(teamId: string, dateRange: DateRange): MentorAggregate[]
countActivitiesByType(teamId: string, period: DateRange): ActivityTypeCounts
getMentorListWithActivity(teamId: string, period: DateRange): MentorActivitySummary[]

Related Data Entities (3)

Data entities managed by this component