From 8082a14e1b542420674003d74ac0e7876d4f773a Mon Sep 17 00:00:00 2001 From: Susana Date: Mon, 12 Jan 2026 08:48:43 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Corregir=20c=C3=A1lculo=20de=20transfer?= =?UTF-8?q?=5Frate=20en=20m=C3=A9tricas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- frontend/utils/analysisGenerator.ts | 2 +- frontend/utils/backendMapper.ts | 3 ++- frontend/utils/realDataAnalysis.ts | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/utils/analysisGenerator.ts b/frontend/utils/analysisGenerator.ts index 71ac50f..ae96606 100644 --- a/frontend/utils/analysisGenerator.ts +++ b/frontend/utils/analysisGenerator.ts @@ -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: { diff --git a/frontend/utils/backendMapper.ts b/frontend/utils/backendMapper.ts index aa29825..a78f22c 100644 --- a/frontend/utils/backendMapper.ts +++ b/frontend/utils/backendMapper.ts @@ -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) ) ); diff --git a/frontend/utils/realDataAnalysis.ts b/frontend/utils/realDataAnalysis.ts index e9ef3b3..ea98a35 100644 --- a/frontend/utils/realDataAnalysis.ts +++ b/frontend/utils/realDataAnalysis.ts @@ -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: {