michangarrito/apps/backend/dist/modules/referrals/referrals.service.d.ts
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

33 lines
1.5 KiB
TypeScript

import { Repository, DataSource } from 'typeorm';
import { ReferralCode } from './entities/referral-code.entity';
import { Referral } from './entities/referral.entity';
import { ReferralReward } from './entities/referral-reward.entity';
export declare class ReferralsService {
private readonly codeRepo;
private readonly referralRepo;
private readonly rewardRepo;
private readonly dataSource;
constructor(codeRepo: Repository<ReferralCode>, referralRepo: Repository<Referral>, rewardRepo: Repository<ReferralReward>, dataSource: DataSource);
getMyCode(tenantId: string): Promise<ReferralCode>;
generateCode(tenantId: string): Promise<ReferralCode>;
validateCode(code: string): Promise<ReferralCode>;
applyCode(referredTenantId: string, code: string): Promise<Referral>;
getReferralByReferred(referredTenantId: string): Promise<Referral | null>;
getMyReferrals(tenantId: string): Promise<Referral[]>;
convertReferral(referredTenantId: string): Promise<Referral>;
getMyRewards(tenantId: string): Promise<ReferralReward[]>;
getAvailableMonths(tenantId: string): Promise<number>;
useReferralMonth(tenantId: string): Promise<boolean>;
getStats(tenantId: string): Promise<{
code: string;
totalInvited: any;
totalConverted: any;
totalPending: any;
totalExpired: any;
monthsEarned: any;
monthsAvailable: any;
}>;
getReferredDiscount(tenantId: string): Promise<number>;
markDiscountApplied(tenantId: string): Promise<void>;
}