medium complexity v1.0 extracted Reporting & Export Confidence: 100%
3
Components
43
Shared
0
User Stories
Yes
Analyzed

Description

Bufdir Export is the final step in the Bufdir compliance workflow, enabling Org Admins to download the generated report in the format required for official submission. Once a report has been generated and reviewed through Bufdir Report Generation, this feature handles file delivery: producing a downloadable file, recording the export action in the audit trail, and preventing re-export of already-submitted reports without an explicit unlock. The separation from generation enforces a review gate that protects organizations from accidental submission of incomplete or unreviewed data.

Sources & reasoning

The priority matrix tags Bufdir export explicitly as a Phase 2 MUST HAVE admin function. Blueprint models generation and export as two features; both carry [v1.0], matching Phase 2 by ordinal. The export feature depends on generation being committed first, enforcing the mandatory review gate. Audit logging is required because export constitutes a formal compliance action that organizations must be able to evidence.

No source references — this artifact was included based on reasoning alone (see above).

Analysis

Business Value

Separating export from generation creates an audit checkpoint that protects organizations from accidental or premature submissions, which could trigger correction filings with Bufdir. All four organizations currently handle Bufdir reporting manually; a dedicated export action with audit logging gives Org Admins documented proof that the correct version was submitted. The bufdir_exports table provides a submission history per organization, directly valuable during Bufdir audits or disputes about reported figures. For organizations receiving multi-million NOK grants, having a traceable export trail is both a governance requirement and a practical protection against administrative errors in annual reporting cycles.

Implementation Notes

The export action is a Next.js API route that retrieves the finalized report record from bufdir_exports and streams it as a downloadable file (CSV or XLSX depending on Bufdir's accepted format at deployment time). An export_status flag on the bufdir_exports record prevents re-export of already-submitted reports unless an Org Admin explicitly unlocks the record. A confirmation modal displays the report period and key aggregate totals before triggering the download. Every export event is written to audit_logs with user ID, timestamp, organization ID, and report reference. Future direct API integration with Bufdir's submission portal would replace the download step with a POST, leaving the audit and confirmation logic intact.

Components (46)

User Interface (1)

Service Layer (1)

Data Layer (1)

Shared Components

These components are reused across multiple features

User Stories

No user stories have been generated for this feature yet.