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

Description

Data access layer that persists and retrieves referral link records, click events, and conversion outcomes. It provides the storage backbone for the referral attribution system.

Feature: Invite Link & QR Sharing

referral-repository

Sources & reasoning

Line 117 names vervefunksjonalitet as a unique HLF need. Line 164 of the priority matrix assigns it to Phase 3 with SHOULD priority for HLF only, and Norse Test. Phase 3 maps to v1.1 per the normalization rules. The blueprint area taxonomy (line 473) names Invite Link & QR Sharing as the first feature under referral-program, confirming this is one of the two canonical sub-features of the area.

  • docs/source/likeperson.md · line 117
    Vervefunksjonalitet for medlemsverving (appen som markedsført medlemsfordel).
  • docs/source/likeperson.md · line 164
    Verving / Referral (invite-link, rekruttering) | - | - | - | ✓ | ✓ | SHOULD (HLF) | 3
  • docs/source/likeperson.md · line 361
    Verving / Referral (HLF)

Responsibilities

  • Store invite link records keyed by mentor ID and token
  • Retrieve active invite link for a given mentor
  • Persist click event log entries with timestamp and metadata
  • Persist conversion records linking tokens to newly registered users
  • Support queries for referral statistics per mentor

Interfaces

saveInviteLink(link: InviteLink): Promise<void>
findLinkByMentorId(mentorId: string): Promise<InviteLink | null>
findLinkByToken(token: string): Promise<InviteLink | null>
saveClickEvent(event: ClickEvent): Promise<void>
saveConversion(conversion: ReferralConversion): Promise<void>
getStatsForMentor(mentorId: string): Promise<ReferralStats>

Related Data Entities (2)

Data entities managed by this component