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

Description

Data access layer for all recruitment and referral data stored in the member_recruitments table. Provides typed CRUD operations for referral records, referrer counts, and attribution tracking. Interfaces with Supabase for persistence and real-time updates.

Feature: Member Recruitment

recruitment-repository

Responsibilities

  • Create and persist referral event records in member_recruitments table
  • Query referral history and status by referrer user ID
  • Update referral completion status when sign-up is confirmed
  • Retrieve referrer recruitment count for badge calculation
  • Delete or expire referral records past the attribution window

Interfaces

createReferral(referral)
getReferralByCode(code)
getReferralsByReferrer(userId)
updateReferralStatus(code, status)
getReferrerCount(userId)
incrementReferrerCount(userId)
deleteExpiredReferrals(beforeDate)
listPendingReferrals(orgId)

Related Data Entities (2)

Data entities managed by this component