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

Description

Persistence layer holding invite tokens, their inviter and organization bindings, and redemption records. Provides the durable attribution trail used by recruitment reporting.

Feature: Invite Link & QR Sharing

invite-store

Sources & reasoning

Listed verbatim in the canonical area taxonomy under referral-program, and motivated by HLF's stated need for app-as-marketed-membership-benefit recruitment functionality. Matrix row 114 places it in Phase 3, which maps to the Growth & Engagement phase name used in §5.

Responsibilities

  • Persist invite tokens with inviter, org, and expiry metadata
  • Record redemption events tying recruits back to inviters
  • Enforce uniqueness of active tokens per inviter
  • Support lookup by token, by inviter, and by organization

Interfaces

insertInvite(invite): InviteId
findByToken(token): Invite | null
findByInviter(userId): Invite[]
recordRedemption(inviteId, newUserId): void