fix: Corregir cálculo de transfer_rate en métricas

- transfer_rate ahora muestra el % real de transferencias
- FCR = 100 - transfer_rate (resolución en primer contacto)
- Antes ambos mostraban el mismo valor (FCR)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Susana
2026-01-12 08:48:43 +00:00
parent 7e24f4eb31
commit 8082a14e1b
3 changed files with 8 additions and 5 deletions

View File

@@ -617,7 +617,7 @@ const generateHeatmapData = (
aht: isNaN(aht_mean) ? 0 : Math.max(0, Math.min(100, Math.round(100 - ((aht_mean - 240) / 310) * 100))),
csat: isNaN(avgCsat) ? 0 : Math.max(0, Math.min(100, Math.round(avgCsat))),
hold_time: isNaN(avg_hold_time) ? 0 : Math.max(0, Math.min(100, Math.round(100 - (avg_hold_time / 120) * 100))),
transfer_rate: isNaN(transfer_rate) ? 0 : Math.max(0, Math.min(100, Math.round(100 - (transfer_rate * 100))))
transfer_rate: isNaN(transfer_rate) ? 0 : Math.max(0, Math.min(100, Math.round(transfer_rate * 100)))
},
annual_cost,
variability: {

View File

@@ -1008,11 +1008,12 @@ export function buildHeatmapFromBackend(
)
: 0;
// Transfer rate es el % real de transferencias (NO el complemento)
const transferMetric = Math.max(
0,
Math.min(
100,
Math.round(100 - transfer_rate)
Math.round(transfer_rate)
)
);

View File

@@ -224,12 +224,14 @@ function generateHeatmapFromMetrics(
: 'medium' as CustomerSegment;
// Scores de performance (normalizados 0-100)
// FCR = 100 - transfer_rate (si no hay transferencia, hay resolución en primer contacto)
const fcr_score = Math.round(100 - m.transfer_rate);
const aht_score = Math.round(Math.max(0, Math.min(100, 100 - ((m.aht_mean - 240) / 310) * 100)));
const csat_score = avgCsat;
const hold_time_score = Math.round(Math.max(0, Math.min(100, 100 - (m.hold_time_mean / 60) * 10)));
const transfer_rate_score = Math.round(100 - m.transfer_rate);
// Transfer rate es el % real de transferencias (NO el complemento)
const actual_transfer_rate = Math.round(m.transfer_rate);
return {
skill: m.skill,
volume: m.volume,
@@ -239,7 +241,7 @@ function generateHeatmapFromMetrics(
aht: aht_score,
csat: csat_score,
hold_time: hold_time_score,
transfer_rate: transfer_rate_score
transfer_rate: actual_transfer_rate
},
automation_readiness: Math.round(agentic_readiness * 10),
variability: {