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: {