Admin Export Service
Component Detail
Description
Generates CSV and Excel exports of org-level data for Bufdir grant reporting and internal governance. Queries activity, reimbursement, and user data within the configured org scope and date range, then formats output per Bufdir's required column structure. Returns a file path or download URL for client retrieval.
admin-export-service
Summaries
The Admin Export Service directly supports the organisation's ability to fulfil grant reporting obligations to Bufdir, a critical funding requirement. Without accurate, correctly formatted exports, the organisation risks delayed or denied grant disbursements. By automating data aggregation and formatting to Bufdir's exact column specification, this service eliminates manual spreadsheet work, reduces human error in reporting, and ensures consistent, auditable outputs. It also supports internal governance by enabling leadership to extract activity and reimbursement data on demand, improving operational visibility without requiring engineering involvement.
Medium complexity, but with a hard external dependency: the Bufdir column structure must be confirmed with stakeholders before implementation begins — any ambiguity here will cause rework. The service depends on both admin-repository and org-hierarchy-service being complete and stable. Plan for a dedicated QA phase with real data samples to validate column mapping and edge cases (empty date ranges, orgs with no activity). Export jobs for large orgs may be long-running; ensure the architecture includes async job handling with a cancellation path (`cancelExport`) to avoid blocking the UI.
File storage or signed URL generation for downloads adds an infrastructure dependency to scope.
Backend service that orchestrates multi-table aggregation queries across activity, reimbursement, and user data, scoped to a list of org IDs provided by org-hierarchy-service. The `generateExport()` method accepts an `ExportConfig` (org scope, date range, format) and returns an `ExportResult` containing a file path or signed download URL. Output formatting must match Bufdir's required CSV/Excel column structure — consider a column-mapping configuration file to keep this maintainable as requirements evolve. For large datasets, implement streaming or chunked query pagination to avoid memory spikes.
The `previewExportRowCount()` interface enables the UI to warn users before triggering expensive jobs. Depends on admin-repository for raw data access.
Responsibilities
- Query and aggregate data for the configured export scope and period
- Format output as CSV or Excel matching Bufdir reporting requirements
- Return file path or shareable download URL to calling UI component
Interfaces
generateExport(config: ExportConfig) -> ExportResult
getExportFormats() -> List<ExportFormat>
previewExportRowCount(config) -> int
cancelExport(jobId) -> void
Relationships
Dependencies (2)
Components this component depends on
Dependents (2)
Components that depend on this component