export type ReferralStatus = 'PENDING' | 'ACTIVE' | 'REWARDED' | 'EXPIRED';
export type RewardStatus = 'PENDING' | 'APPLIED' | 'EXPIRED';

export interface ReferralRelationship {
  id: string;
  referrerTenantId: string;
  referredTenantId: string;
  referralCode: string;
  level: number;
  status: ReferralStatus;
  registeredAt: string;
  activatedAt: string | null;
  rewardedAt: string | null;
}

export interface ReferralReward {
  id: string;
  beneficiaryTenantId: string;
  referralRelationshipId: string;
  rewardType: 'CREDIT' | 'PERCENTAGE';
  triggerType: 'FIRST_PAYMENT' | 'RECURRING';
  amountCents: number;
  amountFormatted: string;
  status: RewardStatus;
  invoiceId: string | null;
  sourceInvoiceId: string | null;
  recurringMonth: number | null;
  createdAt: string;
  appliedAt: string | null;
}

export interface ReferralAdminStats {
  totalReferrals: number;
  activeReferrals: number;
  pendingRewards: number;
}

export interface PaginatedResult<T> {
  items: T[];
  total: number;
}
