feat(helpdesk): add ticket grid filters and resolve support user names in chat

Add 3 new ticket list filters: Support User (dynamic select), Contact (dynamic
select), and Period (30/90/180/365 days). Extend categories endpoint to also
return support_users and contacts arrays from the same cached ticket data.
Add server-side filtering for all three in the data endpoint.

Resolve support user abbreviation codes to full names in the communication chat
widget. For single-ticket view, infer code-to-name from Support_User_Name when
only one support code appears. For debitor view, build map from already-fetched
entries across tickets with no additional API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 16:37:07 +02:00
parent eed1e848df
commit 7220aa7459
7 changed files with 332 additions and 62 deletions

View File

@@ -21,7 +21,7 @@ class TicketCommunicationServiceTest extends TestCase
]);
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketLog')->with('T26-1216')->willReturn([
$odataGateway->expects($this->any())->method('getTicketLog')->with('T26-1216')->willReturn([
[
'Entry_No' => 1,
'Created_By' => 'ICTEST',
@@ -60,7 +60,7 @@ class TicketCommunicationServiceTest extends TestCase
]);
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketLog')->with('T26-1216')->willReturn([
$odataGateway->expects($this->any())->method('getTicketLog')->with('T26-1216')->willReturn([
[
'Entry_No' => 1,
'Created_By' => 'ICTEST',
@@ -105,8 +105,8 @@ class TicketCommunicationServiceTest extends TestCase
}
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketsForCustomer')->with('10001', 'Test GmbH')->willReturn($tickets);
$odataGateway->method('getContactsForCustomer')->with('', 'Test GmbH')->willReturn([]);
$odataGateway->expects($this->any())->method('getTicketsForCustomer')->with('10001', 'Test GmbH')->willReturn($tickets);
$odataGateway->expects($this->any())->method('getContactsForCustomer')->with('', 'Test GmbH')->willReturn([]);
$odataGateway->method('getTicketLog')->willReturnCallback(static function (string $ticketNo): array {
return [[
'Entry_No' => 1,
@@ -147,7 +147,7 @@ class TicketCommunicationServiceTest extends TestCase
]);
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketsForCustomer')->with('10001', 'Test GmbH')->willReturn([
$odataGateway->expects($this->any())->method('getTicketsForCustomer')->with('10001', 'Test GmbH')->willReturn([
['No' => 'T1', 'Last_Activity_Date' => '2026-04-10T08:00:00Z', 'Created_On' => '2026-04-09T08:00:00Z'],
['No' => 'T2', 'Last_Activity_Date' => '2026-04-09T08:00:00Z', 'Created_On' => '2026-04-08T08:00:00Z'],
]);
@@ -193,7 +193,7 @@ class TicketCommunicationServiceTest extends TestCase
]);
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketLog')->with('T26-1216')->willReturn([]);
$odataGateway->expects($this->any())->method('getTicketLog')->with('T26-1216')->willReturn([]);
$service = new TicketCommunicationService($soapGateway, $odataGateway);
$result = $service->loadTicketCommunicationFeed('T26-1216', 2);
@@ -249,7 +249,7 @@ class TicketCommunicationServiceTest extends TestCase
]);
$odataGateway = $this->createMock(BcODataGateway::class);
$odataGateway->method('getTicketLog')->with('T26-1204')->willReturn([
$odataGateway->expects($this->any())->method('getTicketLog')->with('T26-1204')->willReturn([
[
'Entry_No' => 19356,
'Created_By' => 'KT002967',
@@ -260,12 +260,12 @@ class TicketCommunicationServiceTest extends TestCase
'Record_ID' => 'Hallo',
],
]);
$odataGateway->method('getTicket')->with('T26-1204')->willReturn([
$odataGateway->expects($this->any())->method('getTicket')->with('T26-1204')->willReturn([
'No' => 'T26-1204',
'Company_Contact_Name' => 'Aero-Dienst GmbH',
'Current_Contact_Name' => 'Fallback Kontakt',
]);
$odataGateway->method('getContactsForCustomer')->with('', 'Aero-Dienst GmbH')->willReturn([
$odataGateway->expects($this->any())->method('getContactsForCustomer')->with('', 'Aero-Dienst GmbH')->willReturn([
[
'No' => 'KT002967',
'Name' => 'Felix Schneider',