13 lines
593 B
TypeScript
13 lines
593 B
TypeScript
import { ReferralProfile } from '../entities/referral-profile.entity';
|
|
|
|
export const REFERRAL_PROFILE_REPOSITORY = 'REFERRAL_PROFILE_REPOSITORY';
|
|
|
|
export interface IReferralProfileRepository {
|
|
findByUserId(userId: string): Promise<ReferralProfile | null>;
|
|
findByCode(code: string): Promise<ReferralProfile | null>;
|
|
existsByCode(code: string): Promise<boolean>;
|
|
existsByUserId(userId: string): Promise<boolean>;
|
|
findDirectReferrals(referrerId: string, offset: number, limit: number): Promise<[ReferralProfile[], number]>;
|
|
save(profile: ReferralProfile): Promise<ReferralProfile>;
|
|
}
|