Report Aggregation Service
Component Detail
Service Layer
high complexity
backend
1
Dependencies
1
Dependents
12
Entities
0
Integrations
Description
Executes the complex SQL aggregation queries that compile all relevant activity data for a reporting period into a structured intermediate object. Handles activity counts, participant counts, duration totals, and organization hierarchy roll-up required by Bufdir's reporting fields.
report-aggregation-service
Responsibilities
- Query activities table for the given organization and period with all joins
- Aggregate activity counts by type, contact category, and activity subtype
- Roll up data across organization hierarchy (local association → region → national)
- Detect and flag duplicate activities or data gaps for coordinator review
Interfaces
aggregateForPeriod(organizationId, startDate, endDate)
getActivityCountsByType(filters)
getParticipantTotals(filters)
getDurationTotals(filters)
detectDataAnomalies(aggregatedData)
getRollupByHierarchy(organizationId, period)
Relationships
Related Data Entities (12)
Data entities managed by this component
Activity
20 fields
core
Activity Type
13 fields
configuration
Bufdir Report
20 fields
core
Contact
17 fields
core
Document
15 fields
core
Event
19 fields
core
Event Attendee
11 fields
core
Local Association
17 fields
core
Organization
14 fields
core
Region
6 fields
core
Report
17 fields
derived
User
18 fields
core