Data Layer high complexity backend
0
Dependencies
2
Dependents
9
Entities
0
Integrations

Description

Data access layer that executes PostgreSQL CTE-based aggregation queries to compute per-peer-mentor activity totals scoped to a coordinator's association. Joins peer_mentors, user_organization_roles, activities, and activity_types tables with parameterized filters for date range, activity type, and individual peer mentor.

Feature: Coordinator Team Reports

team-report-repository

Responsibilities

  • Execute CTE aggregation query returning per-mentor activity count and total duration
  • Scope all queries to the coordinator's association via user_organization_roles join
  • Support parameterized filters: association_id, date_from, date_to, peer_mentor_id, activity_type_id
  • Return raw export dataset for CSV/PDF generation
  • Fetch available filter options (distinct activity types, peer mentors in association)

Interfaces

getAggregatedTeamReport(params: TeamReportParams)
getPeerMentorActivityDetail(peerMentorId, params)
getExportDataset(params: TeamReportParams)
getActivityTypesInAssociation(associationId)
getPeerMentorsInAssociation(associationId)

Relationships

Dependents (2)

Components that depend on this component