diff --git a/files/custom/Espo/Modules/SmartAssistant/Services/ActionExecutor.php b/files/custom/Espo/Modules/SmartAssistant/Services/ActionExecutor.php index fd1034e..62fa4b1 100644 --- a/files/custom/Espo/Modules/SmartAssistant/Services/ActionExecutor.php +++ b/files/custom/Espo/Modules/SmartAssistant/Services/ActionExecutor.php @@ -44,6 +44,7 @@ class ActionExecutor 'create_call' => $this->createCall($params, $caseId, $userId), 'delete_meeting' => $this->deleteMeeting($params), 'delete_call' => $this->deleteCall($params), + 'delete_task' => $this->deleteTask($params), 'delete_note' => $this->deleteNote($params), 'schedule_hearing' => $this->scheduleHearing($params, $caseId, $userId), 'list_documents' => $this->listDocuments($caseId), @@ -288,6 +289,29 @@ class ActionExecutor ]; } + private function deleteTask(array $params): array + { + $entityId = $params['entityId'] ?? null; + if (!$entityId) { + throw new Error('entityId parameter is required.'); + } + + $entity = $this->entityManager->getEntityById('Task', $entityId); + if (!$entity) { + throw new NotFound("Task {$entityId} not found."); + } + + $name = $entity->get('name') ?? ''; + $this->entityManager->removeEntity($entity); + + return [ + 'success' => true, + 'message' => "✅ משימה \"{$name}\" נמחקה בהצלחה", + 'entityType' => 'Task', + 'entityId' => $entityId, + ]; + } + private function scheduleHearing(array $params, ?string $caseId, string $userId): array { $case = $this->entityManager->getEntityById('Case', $caseId); diff --git a/manifest.json b/manifest.json index 9d8270e..236786c 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "module": "SmartAssistant", "description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and AI Gateway integration", "author": "klear", - "version": "2.5.1", + "version": "2.5.2", "acceptableVersions": [ ">=8.0.0" ],