Service Layer medium complexity mobile
1
Dependencies
1
Dependents
1
Entities
0
Integrations

Description

Manages generation, retrieval, and lifecycle of personalized referral invite tokens and short URLs. Communicates with the backend REST API to create unique tokens scoped to the referring user and organization. Handles token expiry, refresh, and deep link construction.

Feature: Invite Link & QR Sharing

referral-link-service

Responsibilities

  • Request token generation from backend API (POST /api/v1/referrals/generate)
  • Cache active invite token locally to avoid redundant API calls
  • Construct full deep link URL from token (Firebase Dynamic Links or Universal Links)
  • Detect and signal token expiry, triggering refresh
  • Scope tokens to organization for multi-tenancy correctness

Interfaces

generateInviteLink(userId, organizationId): Future<ReferralLink>
getActiveInviteLink(userId): Future<ReferralLink?>
refreshInviteLink(userId, organizationId): Future<ReferralLink>
isTokenExpired(token): bool

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component