Data Layer high complexity backend
0
Dependencies
2
Dependents
5
Entities
0
Integrations

Description

Data access layer for the bufdir_reports and reports tables. Executes the complex aggregate SQL query joining activities, users, organizations, and activity_types filtered by reporting period and organization scope. Also records generated report metadata in generated_files for audit purposes.

Feature: Admin Bufdir Report Export

bufdir-report-repository

Responsibilities

  • Execute aggregate query across activities, users, organizations, and activity_types for a given period and org scope
  • Persist generated report metadata to bufdir_reports and generated_files tables
  • Retrieve export history records for a given organization
  • Validate completeness of activity data before aggregation

Interfaces

aggregateActivitiesForPeriod(orgId, startDate, endDate)
saveReportMetadata(reportData)
getReportHistory(orgId, limit)
getValidationSummary(orgId, startDate, endDate)
findReportById(reportId)
markReportAsDownloaded(reportId)

Relationships

Dependents (2)

Components that depend on this component