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

Description

Backend service that records recruitment events along the invite lifecycle and computes per-user and aggregated metrics. It enforces role-scoped access so personal numbers stay private while coordinators see organization-wide rollups.

Feature: Recruitment Tracking

recruitment-tracking-service

Sources & reasoning

Named verbatim in the canonical area taxonomy as the second feature of referral-program. Required to make invite-link-qr-sharing measurable; without tracking, HLF's recruitment use case cannot be reported on. Matrix Phase 3 maps to Growth & Engagement.

Responsibilities

  • Record invite, open, signup, and activation events tied to the originating mentor and channel
  • Compute per-user funnel counts and conversion rates over requested time windows
  • Aggregate metrics by mentor, channel, and organization for coordinator and admin views
  • Enforce role-based scoping so users only see their own data unless authorized for rollups
  • Expose attribution data linking each new recruit back to the inviting mentor

Interfaces

recordRecruitmentEvent(inviteId, eventType, metadata): void
getPersonalFunnel(userId, window): RecruitmentFunnel
getAggregatedFunnel(scope, window): AggregatedFunnel
getChannelAttribution(scope, window): ChannelAttribution[]