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

Description

Orchestrates the end-to-end export workflow for a Bufdir report snapshot. It coordinates file generation, triggers the browser download, and records an audit log entry for every completed export event. It enforces that only snapshots in a finalized state may be exported.

Feature: Bufdir Export

bufdir-export-service

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

  • Validate that the referenced snapshot is in a finalized, exportable state
  • Request file generation from ExportFileGenerator with the chosen format
  • Trigger file download delivery to the client
  • Write an audit log record capturing organization, user, snapshot ID, format, and timestamp
  • Return structured error responses for invalid snapshot state or generation failures

Interfaces

exportSnapshot(snapshotId: string, format: ExportFormat, userId: string): Promise<ExportResult>
getExportHistory(organizationId: string): Promise<AuditLogEntry[]>
validateSnapshotExportable(snapshotId: string): Promise<boolean>

Related Data Entities (2)

Data entities managed by this component