You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tiempo-beneficios): add client benefit time analysis tools with anti-timeout optimizations
- Add individual client time to benefits analysis (get_tiempo_beneficios_cliente)
- Add bulk analysis tool for all clients (get_tiempo_beneficios_todos_clientes)
- Implement comprehensive statistical reporting with medians, distributions, and payment patterns
- Add rate limiting and timeout prevention optimizations:
* Maximum 50 clients per request when incluir_sin_facturas=false (anti-timeout)
* Maximum 100 clients per request when incluir_sin_facturas=true (anti-rate-limit)
* Early exit pattern for clients without invoices
* Timeout protection with 25-second processing limit
- Change default incluir_sin_facturas to false for business-focused revenue analysis
- Add comprehensive pagination documentation and examples
- Include 14 unit tests covering all scenarios and optimizations
Business benefits:
- ROI analysis from client registration to first payment
- Cash flow management with payment pattern insights
- Collection strategy optimization based on client payment behavior
- Client retention analysis through payment timing distributions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
description: 'Calcula el tiempo que tarda un cliente en generar beneficios desde su alta hasta el primer y último pago de facturas. Realiza análisis en tres pasos: 1) Busca datos del cliente por código, 2) Obtiene facturas del cliente, 3) Consulta recibos/pagos asociados. Calcula días desde fecha alta hasta primer y último pago, totales facturados y pagados. Útil para análisis de retorno de inversión en clientes, gestión de tesorería y estrategias de cobranza.',
443
+
inputSchema: {
444
+
type: 'object',
445
+
properties: {
446
+
codcliente: {type: 'string',description: 'Código del cliente para analizar (requerido)'}
447
+
},
448
+
required: ['codcliente']
449
+
}
450
+
},
451
+
{
452
+
name: 'get_tiempo_beneficios_todos_clientes',
453
+
description: 'Calcula el tiempo hasta beneficios para todos los clientes en un análisis bulk. Devuelve el detalle individual de cada cliente y un informe estadístico completo con medias, medianas, totales y distribuciones. Realiza procesamiento eficiente en lote para análisis masivos de rentabilidad de clientes. Útil para obtener insights generales de la cartera de clientes, identificar patrones de pago y optimizar estrategias de cobranza.',
454
+
inputSchema: {
455
+
type: 'object',
456
+
properties: {
457
+
limit: {type: 'number',description: 'Número máximo de clientes a procesar (1-500)',minimum: 1,maximum: 500,default: 100},
458
+
offset: {type: 'number',description: 'Número de clientes a omitir para paginación',minimum: 0,default: 0},
459
+
incluir_sin_facturas: {type: 'boolean',description: 'Si incluir clientes sin facturas en el análisis',default: true}
460
+
}
461
+
}
462
+
},
438
463
{
439
464
name: 'get_clientes_perdidos',
440
465
description: 'Obtiene una lista de clientes que tenían facturas anteriormente pero no han comprado desde una fecha específica hasta ahora. Excluye clientes que nunca han comprado (sin historial de facturas). Realiza análisis en tres pasos: 1) Obtiene todos los clientes con historial de facturas, 2) Identifica clientes con facturas anteriores a la fecha límite, 3) Filtra aquellos sin facturas desde la fecha hasta hoy. Útil para campañas de recuperación de clientes perdidos, análisis de retención y estrategias de reactivación.',
0 commit comments