Infrastructure medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Converts a Bufdir report snapshot data structure into the target file format (CSV, XLSX, or Bufdir-specified structured file). It operates as a stateless transformation layer that accepts structured report data and returns a binary buffer ready for download. Format-specific serialization logic is encapsulated here to keep service and UI layers format-agnostic.

Feature: Bufdir Export

export-file-generator

Sources & reasoning

Fase 2 placement (line 145, Fase column = 2) normalizes to v1.0. The 'ett klikk' phrasing (line 342) describes the export action specifically. Line 375 flags that the exact file format is subject to Bufdir negotiation, which is captured as a configuration point in implementation notes.

  • Bufdir-rapportering og eksport med ett klikk (kun i Admin Web Portal; mobilen bidrar med selve aktivitetsregistreringen)
  • Norse Digital Products tar initiativ til dialog med Bufdir på vegne av alle organisasjonene.

Responsibilities

  • Serialize report snapshot data to CSV format per Bufdir field mapping
  • Serialize report snapshot data to XLSX format with correct column headers and data types
  • Serialize report snapshot data to Bufdir-specified structured file format when required
  • Return a binary buffer and MIME type for use by the download delivery mechanism
  • Validate that all required Bufdir fields are present before serialization

Interfaces

generate(snapshot: ReportSnapshot, format: ExportFormat): Promise<FileBuffer>
getSupportedFormats(): ExportFormat[]
validateRequiredFields(snapshot: ReportSnapshot): ValidationResult