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

Description

Data access layer for persisting and retrieving generated Bufdir reports and their metadata. It provides queryable storage of report records keyed by organization and reporting period, enabling re-download and audit history. Reads from the activity and participant data tables to support report generation queries.

Feature: Bufdir Report Generation

bufdir-report-repository

Sources & reasoning

Line 46 establishes Bufdir reporting as a universal must-have across all four orgs. Line 144 confirms MUST HAVE with Phase 2 placement. Line 342 places it explicitly in Phase 2 (v1.0). Blueprint assigns v1.0, consistent with Phase 2 mapping. Generation is architecturally separate from export to allow report preview before submission.

  • docs/source/likeperson.md · line 46
    Alle 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 144
    Bufdir-rapportering (eksport, admin) | ✓ | ✓ | ✓ | ✓ | ✓ | MUST HAVE | 2
  • docs/source/likeperson.md · line 342
    Bufdir-rapportering og eksport med ett klikk (kun i Admin Web Portal; mobilen bidrar med selve aktivitetsregistreringen)

Responsibilities

  • Persist generated Bufdir report metadata including period, org, and generation timestamp
  • Retrieve historical reports by organization ID and date range
  • Query aggregated activity counts and participant data for a reporting period
  • Delete or archive expired report records according to retention policy

Interfaces

saveReport(report: BufdirReport): Promise<string>
getReportById(reportId: string): Promise<BufdirReport | null>
listReportsByOrg(orgId: string, limit: number): Promise<BufdirReport[]>
queryActivityAggregates(orgId: string, from: Date, to: Date): Promise<ActivityAggregate[]>

Related Data Entities (3)

Data entities managed by this component