import { apiClient } from './client'; export interface ClientesStats { suscripcionesPorPlan: Array<{ plan: string; count: number }>; ingresos: { total: number; paymentsCount: number }; noRenovaciones: Array<{ tenantId: string; tenantNombre: string; rfc: string; plan: string; currentPeriodEnd: string; statusActual: string; }>; usuariosPorCliente: Array<{ tenantId: string; tenantNombre: string; rfc: string; activeUsers: number; owners: number; }>; } export interface TenantUsuario { userId: string; email: string; nombre: string; rol: string; isOwner: boolean; joinedAt: string; lastLogin: string | null; } export async function getClientesStats(from?: string, to?: string): Promise { const params = new URLSearchParams(); if (from) params.set('from', from); if (to) params.set('to', to); const res = await apiClient.get(`/admin/clientes/stats?${params}`); return res.data; } export async function getTenantUsuarios(tenantId: string): Promise { const res = await apiClient.get<{ data: TenantUsuario[] }>(`/admin/clientes/${tenantId}/usuarios`); return res.data.data; }