import { type LeadEntity } from '../entities/lead.entity';
import { type LeadReadDto } from './lead-read.dto';

export const LEAD_REPOSITORY = Symbol('LEAD_REPOSITORY');

export interface PaginatedResult<T> {
  data: T[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

export interface LeadStatsData {
  totalLeads: number;
  byStatus: Record<string, number>;
  conversionRate: number;
  avgScore: number | null;
}

export interface ILeadRepository {
  findById(id: string): Promise<LeadEntity | null>;
  save(lead: LeadEntity): Promise<void>;
  update(lead: LeadEntity): Promise<void>;
  delete(id: string): Promise<void>;
  findByAgent(agentId: string, status: string | null, page: number, limit: number): Promise<PaginatedResult<LeadReadDto>>;
  getStatsByAgent(agentId: string): Promise<LeadStatsData>;
}
