Update remote soul-content with local content
This commit is contained in:
32
lib/modules/referral/types.ts
Normal file
32
lib/modules/referral/types.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
export interface ReferralCode {
|
||||
code: string;
|
||||
ownerId: string;
|
||||
createdAt: Date;
|
||||
campaignId?: string;
|
||||
}
|
||||
|
||||
export interface ReferralStats {
|
||||
userId: string;
|
||||
totalClicks: number;
|
||||
totalConversions: number;
|
||||
totalEarnings: number;
|
||||
pendingEarnings: number;
|
||||
}
|
||||
|
||||
export interface ReferralRecord {
|
||||
id: string;
|
||||
referrerId: string;
|
||||
refereeId: string; // The new user
|
||||
action: 'register' | 'purchase';
|
||||
amount?: number; // Purchase amount if applicable
|
||||
commission: number;
|
||||
status: 'pending' | 'paid' | 'cancelled';
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface ReferralService {
|
||||
generateCode(userId: string): Promise<string>;
|
||||
trackVisit(code: string, visitorInfo: any): Promise<void>;
|
||||
recordConversion(code: string, action: 'register' | 'purchase', amount?: number): Promise<ReferralRecord>;
|
||||
getStats(userId: string): Promise<ReferralStats>;
|
||||
}
|
||||
Reference in New Issue
Block a user