Service Layer medium complexity mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Core business logic service that orchestrates member recruitment through referral links. Handles referral link generation with encoded user ID and organisation slug, records referral events in the database, updates the referrer's recruitment count (which feeds into the achievement badges system), and enforces the configurable attribution window (default 30 days).

Feature: Member Recruitment

recruitment-service

Responsibilities

  • Generate unique referral short URLs encoding user ID and organisation slug
  • Record referral events when a new sign-up completes via a referral link
  • Update referrer's recruitment count and trigger badge evaluation
  • Enforce and apply the configurable referral attribution window
  • Coordinate with Member System API Gateway to prevent duplicate member creation

Interfaces

generateReferralLink(userId, orgSlug)
recordReferralEvent(referralCode, newUserId)
getReferralsByUser(userId)
getReferralStatus(referralCode)
getAttributionWindow(orgId)
setAttributionWindow(orgId, days)
incrementReferrerCount(referrerId)
validateReferralCode(code)
expireStaleReferrals()

Related Data Entities (2)

Data entities managed by this component