Referral Link Service
Component Detail
Service Layer
medium complexity
mobilebackend
1
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Generates short, signed invite URLs with an embedded referrer token and configurable expiry window by calling the backend REST API. Caches the active link locally to avoid redundant API calls and exposes referral history and redemption status for display in the Invite Share Screen.
referral-link-service
Responsibilities
- Request a signed invite URL from the backend with referrer token
- Cache the active link locally and serve from cache within expiry window
- Detect link expiry and trigger regeneration transparently
- Fetch referral history and redemption count for the current user
Interfaces
generateInviteLink(userId: String): Future<InviteLink>
getActiveLink(userId: String): Future<InviteLink?>
refreshExpiredLink(userId: String): Future<InviteLink>
getReferralHistory(userId: String): Future<List<Referral>>
redeemToken(token: String, inviteeId: String): Future<void>