feat(helpdesk): clickable top customers/categories filter resolution times

Clicking a customer or category in the Historical tab recalculates
Ø/Min/Max resolution times for only that filter. Click again to reset.
All computation is client-side from resolved_details already in the
response — no extra API calls. Active filter highlighted with primary
color, resolution values turn primary when filtered.

Backend now includes resolved_ticket_details per agent (customer_name,
category, resolution_hours) for client-side filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 20:31:08 +02:00
parent fc98f2684a
commit 5c0364f687
3 changed files with 128 additions and 20 deletions

View File

@@ -1625,6 +1625,7 @@ class DebitorDetailService
'resolved_customers' => [],
'resolved_categories' => [],
'resolution_hours' => [],
'resolved_ticket_details' => [],
];
}
@@ -1642,9 +1643,17 @@ class DebitorDetailService
if ($category !== '') {
$agents[$normalizedUser]['resolved_categories'][$category] = ($agents[$normalizedUser]['resolved_categories'][$category] ?? 0) + 1;
}
$resolutionH = null;
if ($createdTs !== null && $activityTs > $createdTs) {
$agents[$normalizedUser]['resolution_hours'][] = intdiv($activityTs - $createdTs, 3600);
$resolutionH = intdiv($activityTs - $createdTs, 3600);
$agents[$normalizedUser]['resolution_hours'][] = $resolutionH;
}
$agents[$normalizedUser]['resolved_ticket_details'][] = [
'customer_name' => $customerName,
'category' => $category,
'resolution_hours' => $resolutionH,
];
}
} else {
$agents[$normalizedUser]['open_tickets']++;
@@ -1739,6 +1748,7 @@ class DebitorDetailService
'avg_resolution_hours' => $avgResolution,
'min_resolution_hours' => $minResolution,
'max_resolution_hours' => $maxResolution,
'resolved_details' => $agent['resolved_ticket_details'],
],
];
}