Report Data Aggregation Service
Component Detail
Service Layer
high complexity
backend
0
Dependencies
1
Dependents
5
Entities
0
Integrations
Description
Specialized backend service handling the complex data aggregation logic required for Bufdir report content. Joins activity, contact, and coordinator datasets per the Bufdir spec, resolves multi-organization coordinator memberships, and applies deduplication rules to prevent double-counting proxy-reported activities.
report-data-aggregation-service
Responsibilities
- Aggregate peer mentor activity counts grouped by activity type and period within tenant scope
- Compute contact interaction metrics - home visits, phone calls, group sessions
- Resolve coordinator memberships across organizations and attribute activities to the correct org
- Deduplicate proxy-reported activities to prevent double-counting when same event is reported by multiple coordinators
- Format aggregated data into the section structure required by the active Bufdir spec template
Interfaces
aggregateActivityData(scope: ReportScope) -> ActivityAggregation
resolveCoordinatorMemberships(organizationId: string) -> CoordinatorMembershipMap
deduplicateProxyActivities(activities: Activity[]) -> Activity[]
buildReportSections(aggregation: ActivityAggregation, template: BufdirSpecTemplate) -> BufdirReportSections
Relationships
Related Data Entities (5)
Data entities managed by this component