BufdirReportRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Data access layer that queries activity registrations, peer mentor records, and organization data needed to build the Bufdir report dataset. Isolates all database queries related to report assembly and applies organization-level exclusion filters at the query level.
bufdir-report-repository
Sources & reasoning
Matrix column 'Fase' marks Bufdir-rapportering as Fase 2 (line 145), normalizing to v1.0. Lines 342-343 confirm it is an admin-only function. The Norse Test exclusion requirement (lines 130-133) adds a non-trivial implementation constraint captured in notes.
-
docs/source/likeperson.md · line 44-46Alle fire organisasjoner mottar Bufdir-tilskudd og bruker mye tid pĂ„ rapportering. Ănsket er det samme: trykk pĂ„ Ă©n knapp og fĂ„ ut det Bufdir trenger.
-
docs/source/likeperson.md · line 342-343Bufdir-rapportering og eksport med ett klikk (kun i Admin Web Portal; mobilen bidrar med selve aktivitetsregistreringen)
-
docs/source/likeperson.md · line 130-133Brukes ikke i produksjon: Data generert av Norse Test-organisasjonen er testdata og skal ikke inngÄ i Bufdir-rapportering eller Þvrig ekstern rapportering.
Responsibilities
- Query activity registrations filtered by reporting period and organization scope
- Exclude Norse Test Organization records at the database query level
- Fetch associated peer mentor and coordinator metadata required by Bufdir fields
- Aggregate registration counts and activity type breakdowns per the report schema
- Provide raw result sets to BufdirReportService for field mapping
Interfaces
getActivityRegistrations(periodFrom: Date, periodTo: Date, excludeOrgIds: string[]): Promise<ActivityRegistration[]>
getPeerMentorMetadata(mentorIds: string[]): Promise<PeerMentorRecord[]>
getOrganizationScope(excludeTestOrgs: boolean): Promise<string[]>
getAggregatedActivityCounts(periodFrom: Date, periodTo: Date): Promise<ActivityAggregate[]>