import { ReferralRelationship } from '../aggregates'; /** * 推荐关系仓储接口 */ export interface IReferralRelationshipRepository { /** * 保存推荐关系 */ save(relationship: ReferralRelationship): Promise; /** * 根据用户ID查找 */ findByUserId(userId: bigint): Promise; /** * 根据推荐码查找 */ findByReferralCode(code: string): Promise; /** * 查找用户的直推列表 */ findDirectReferrals(userId: bigint): Promise; /** * 检查推荐码是否存在 */ existsByReferralCode(code: string): Promise; /** * 检查用户是否已有推荐关系 */ existsByUserId(userId: bigint): Promise; /** * 获取推荐链 (用于创建新用户时) */ getReferralChain(userId: bigint): Promise; } export const REFERRAL_RELATIONSHIP_REPOSITORY = Symbol('IReferralRelationshipRepository');