RecruitmentTrackingService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Backend service that tracks the full referral funnel from invite link issuance through completed member registration. It aggregates per-mentor recruit counts and exposes team-level summaries for coordinators. It also emits milestone events to the achievements and gamification system when recruitment thresholds are reached.
recruitment-tracking-service
Sources & reasoning
Recruitment tracking is the feedback half of the referral program - the priority matrix places Verving / Referral in Phase 3 (v1.1) as SHOULD for HLF. Without tracking, the invite-link feature has no visibility loop. Blueprint ID recruitment-tracking preserved exactly as specified.
-
docs/source/likeperson.md · line 162| Verving / Referral (invite-link, rekruttering) | - | - | - | ✓ | ✓ | SHOULD (HLF) | 3 |
-
docs/source/likeperson.md · line 117**Vervefunksjonalitet** for medlemsverving (appen som markedsført medlemsfordel).
Responsibilities
- Record each referral link click and associate it with the issuing mentor
- Track registration completion events and link them back to the originating referral
- Aggregate recruit counts per mentor and expose team-level rollups for coordinators
- Emit milestone events when a mentor crosses recruitment thresholds (e.g. 5, 10 recruits)
- Enforce role-based data scoping so mentors only query their own funnel data
Interfaces
getRecruitCountByMentor(mentorId: string): Promise<number>
getRecentRecruits(mentorId: string, limit: number): Promise<Recruit[]>
getTeamRecruitmentSummary(coordinatorId: string): Promise<TeamRecruitmentSummary>
recordReferralClick(inviteLinkId: string, visitorToken: string): Promise<void>
recordRegistrationComplete(userId: string, inviteLinkId: string): Promise<void>
checkAndEmitMilestones(mentorId: string): Promise<MilestoneEvent[]>