Service Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Backend service exposing a paginated REST endpoint that aggregates referral data from the referrals table. Executes a single JOIN query (referrals + users) grouped by referrer_user_id and filtered by the requesting coordinator's organization membership to enforce tenant isolation. Returns recruiter summaries sorted by total redemptions descending.

Feature: Recruitment Tracking

recruitment-analytics-service

Responsibilities

  • Aggregate referrals by referrer with sent and redeemed counts per peer mentor
  • Enforce organization scoping by joining referrals to organization_memberships of the requesting user
  • Support parameterized date-range filtering via query parameters
  • Return paginated recruiter summaries with display names to avoid N+1 queries
  • Expose near-real-time data by reading committed rows without caching delays

Interfaces

GET /api/v1/recruitment/summary?orgId=&from=&to=&page=&pageSize=
getRecruiterSummaries(organizationId, dateRange, pagination) → PagedResult<RecruiterSummary>
getAggregateFunnelStats(organizationId, dateRange) → FunnelStats

Related Data Entities (3)

Data entities managed by this component