Service Layer medium complexity backend
0
Dependencies
0
Dependents
9
Entities
0
Integrations

Description

Backend service that transforms raw activity registration data into the field mapping and structure mandated by Bufdir. Enforces exclusion rules such as filtering out Norse Test Organization records and validates completeness before the dataset is returned for preview or export.

Feature: Bufdir Report Generation

bufdir-report-service

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.

  • 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 342-343
    Bufdir-rapportering og eksport med ett klikk (kun i Admin Web Portal; mobilen bidrar med selve aktivitetsregistreringen)
  • docs/source/likeperson.md · line 130-133
    Brukes ikke i produksjon: Data generert av Norse Test-organisasjonen er testdata og skal ikke inngÄ i Bufdir-rapportering eller Þvrig ekstern rapportering.

Responsibilities

  • Fetch activity registrations for the requested reporting period from the repository
  • Apply Bufdir field mapping rules to transform internal data structures into the required format
  • Enforce test-organization exclusion (Norse Test Organization records must be filtered out)
  • Validate the assembled dataset for completeness and required field presence
  • Serialize the report into the export format (CSV or XLSX) on demand

Interfaces

assembleReport(periodFrom: Date, periodTo: Date): Promise<BufdirReport>
previewReport(periodFrom: Date, periodTo: Date): Promise<BufdirReportPreview>
exportReport(report: BufdirReport, format: ExportFormat): Promise<Buffer>
validateReport(report: BufdirReport): ValidationResult