Bufdir Report
Data Entity
Description
A structured compliance report submitted to Bufdir (Norwegian government agency) containing aggregated activity data for a specific reporting period. Each report belongs to one organization and covers peer mentor activity counts, contact counts, hours, and other statutory metrics required for Bufdir funding.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key, globally unique report identifier | PKrequiredunique |
organization_id |
uuid |
Foreign key to the organization this report belongs to | required |
reporting_period_id |
uuid |
Foreign key to the reporting period (year/half/quarter) this report covers | required |
status |
enum |
Lifecycle state of the report | required |
report_year |
integer |
Calendar year this report covers, e.g. 2025 | required |
period_type |
enum |
Granularity of the reporting period matching Bufdir requirements | required |
period_start |
datetime |
Inclusive start date of the period covered by this report | required |
period_end |
datetime |
Inclusive end date of the period covered by this report | required |
activity_count |
integer |
Total number of approved activities included in this report | - |
peer_mentor_count |
integer |
Number of distinct peer mentors who logged at least one activity in the period | - |
contact_count |
integer |
Number of distinct contacts who received peer mentor support in the period | - |
total_hours |
decimal |
Sum of all activity durations in hours for the period | - |
report_data |
json |
Full aggregated report payload as required by Bufdir: activity breakdown by type, age group statistics, geographic distribution, expense totals. Snapshot at time of generation. | - |
generated_at |
datetime |
Timestamp when the report data was last aggregated and the snapshot generated | - |
generated_by_user_id |
uuid |
User (org admin or coordinator) who triggered report generation | - |
export_format |
enum |
File format selected for the last export | - |
export_file_url |
string |
Signed or permanent URL to the exported report file in cloud storage | - |
exported_at |
datetime |
Timestamp of the most recent file export | - |
exported_by_user_id |
uuid |
User who performed the export | - |
submitted_at |
datetime |
Timestamp when the report was formally marked as submitted to Bufdir | - |
submitted_by_user_id |
uuid |
User who marked the report as submitted | - |
notes |
text |
Internal notes or comments by org admin about this report (not included in export) | - |
created_at |
datetime |
Record creation timestamp | required |
updated_at |
datetime |
Record last-modified timestamp | required |
Database Indexes
idx_bufdir_reports_org_period
Columns: organization_id, reporting_period_id
idx_bufdir_reports_organization_id
Columns: organization_id
idx_bufdir_reports_status
Columns: status
idx_bufdir_reports_report_year
Columns: report_year
idx_bufdir_reports_generated_at
Columns: generated_at
Validation Rules
period_end_after_period_start
error
Validation failed
report_year_matches_period
error
Validation failed
period_type_matches_date_range
error
Validation failed
organization_id_must_exist
error
Validation failed
reporting_period_id_must_exist
error
Validation failed
numeric_metrics_non_negative
error
Validation failed
export_file_url_valid_format
error
Validation failed
Business Rules
one_report_per_org_per_period
Only one Bufdir report may exist per organization per reporting period. Attempting to generate a second report for the same org/period must return the existing draft or raise an error.
period_must_be_complete_before_generation
A report may only be generated once the period_end date is in the past. Generating a report for a future or ongoing period is blocked.
submitted_report_is_immutable
Once a report reaches status=submitted, its report_data, activity_count, peer_mentor_count, contact_count, and total_hours fields are locked and cannot be modified. Only notes and status transitions to 'archived' are permitted.
only_approved_activities_included
The report_data snapshot must only aggregate activities with status=approved. Pending or flagged activities are excluded from all Bufdir metrics.
regeneration_resets_export
If a report in draft/generated status is regenerated, the previous export_file_url, exported_at, and exported_by_user_id must be cleared, as the file no longer reflects the current data.
export_requires_generated_status
A file export (xlsx/pdf/csv) can only be triggered when the report status is 'generated'. Draft reports must be fully generated first.