CustomReportService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Backend service that executes ad-hoc report queries against the data model and manages saved report configurations. Enforces organization-scoped access so reports and their results are isolated per organization. Handles query construction, execution, and export generation from user-defined configurations.
custom-report-service
Sources & reasoning
Custom Reports is not explicitly named in the source doc but appears in the blueprint as a v1.1 feature under admin-reporting. The priority matrix (lines 140-165) covers only the standard Bufdir and team reporting flows; custom analytics is a Fase 3 growth feature by inference from the phasing pattern. Fase 3 normalizes to v1.1.
-
docs/source/likeperson.md · line 353-358Fase 3 - Vekst og engasjement: Gamification / «Ditt likepersonsår» (Wrapped, badges, Advantage Calculator) Kursadministrasjon og sertifisering (HLF + Barnekreftforeningen)
Responsibilities
- Build and execute dynamic SQL queries from report configurations spanning activities, contacts, peer mentors, expenses, events, and certifications
- Validate report configurations and enforce field/filter allowlists to prevent unauthorized data access
- Persist and retrieve saved report configurations scoped to the requesting organization
- Generate CSV and Excel export files from query results
- Enforce role-based access so only organization administrators can create or execute custom reports
Interfaces
executeReport(config: ReportConfig, orgId: string): ReportResult
previewReport(config: ReportConfig, orgId: string, limit: number): ReportPreview
saveReportConfig(config: ReportConfig, name: string, orgId: string): SavedReport
getSavedReports(orgId: string): SavedReport[]
deleteSavedReport(reportId: string, orgId: string): void
exportReport(config: ReportConfig, orgId: string, format: ExportFormat): Buffer
getAvailableFields(orgId: string): FieldSchema[]