feat(helpdesk): add customer engagement analytics page [skip ci]

New "Customer analytics" page under Monitoring: surfaces who is actively in
contact vs. who has gone quiet, so the team can reach out before a customer
slips away.

- KPI tiles: total / active / no-contact / never-in-contact
- "Customers without recent contact" — longest silence first
- "Top customers by communication" — most ticket activity in the period
- Configurable no-contact threshold (helpdesk settings, default 60 days)

CustomerEngagementService aggregates the global ticket snapshot per customer
(same single-pull model as RiskRadarService — no N+1 to BC). Last contact is
the most recent ticket activity; silence beyond the threshold flags the
customer. Revenue ranking deferred (BC OData exposes no per-customer ledger).

All within modules/helpdesk/. Tests + PHPStan green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
aminovfariz
2026-06-25 10:30:05 +02:00
parent 2924407450
commit 14da36e83a
16 changed files with 1150 additions and 46 deletions

View File

@@ -45,6 +45,8 @@ return [
['path' => 'helpdesk/team-workload-data', 'target' => 'helpdesk/team-workload-data'],
['path' => 'helpdesk/risk-radar', 'target' => 'helpdesk/risk-radar'],
['path' => 'helpdesk/risk-radar-data', 'target' => 'helpdesk/risk-radar-data'],
['path' => 'helpdesk/analytics', 'target' => 'helpdesk/analytics'],
['path' => 'helpdesk/analytics-data', 'target' => 'helpdesk/analytics-data'],
['path' => 'helpdesk/software-products', 'target' => 'helpdesk/software-products'],
['path' => 'helpdesk/software-products-data', 'target' => 'helpdesk/software-products-data'],
['path' => 'helpdesk/software-products/edit/{code}', 'target' => 'helpdesk/software-products/edit'],
@@ -138,6 +140,17 @@ return [
'permission' => 'helpdesk.risk-radar.view',
'order' => 805,
],
[
'key' => 'helpdesk-analytics',
'script' => 'modules/helpdesk/js/helpdesk-analytics.js',
'export' => 'initHelpdeskAnalytics',
'selector' => '[data-app-component="helpdesk-analytics"]',
'config_path' => 'components.helpdesk.analytics',
'default_config' => [],
'phase' => 'default',
'permission' => 'helpdesk.risk-radar.view',
'order' => 809,
],
[
'key' => 'helpdesk-settings',
'script' => 'modules/helpdesk/js/helpdesk-settings.js',