Service Layer medium complexity mobile
2
Dependencies
1
Dependents
6
Entities
0
Integrations

Description

Riverpod-managed service that fetches pre-aggregated team report data from the backend REST API, scoped to the coordinator's local association and the selected reporting period. Handles state management, caching, and error propagation for the report screen.

Feature: Coordinator Team Reports

team-report-service

Responsibilities

  • Call GET /api/v1/statistics/team with period and association filters
  • Parse pre-aggregated payload (per-mentor totals, last-active, type breakdown)
  • Expose AsyncValue state for loading, data, and error UI states
  • Apply client-side sort and filter on cached payload without re-fetching
  • Enforce that only Coordinator role can invoke the endpoint; surface 403 as AccessDeniedError

Interfaces

fetchTeamReport(DateRange period) → Future<TeamReportPayload>
sortBy(SortField field, SortOrder order) → void
filterByActivityType(List<String> typeIds) → void
getMentorDetail(String userId) → MentorReportDetail
invalidateCache() → void

Relationships

Dependencies (2)

Components this component depends on

Dependents (1)

Components that depend on this component