them log, chinh upload
Some checks failed
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
Tests / PHP 8.5 (push) Has been cancelled

This commit is contained in:
2026-05-09 11:00:59 +00:00
parent 96e1ce4f40
commit efa97b6c71
33 changed files with 1055 additions and 47 deletions

View File

@@ -6,6 +6,7 @@ use App\Models\Department;
use App\Models\Feedback;
use App\Models\TicketTransferLog;
use App\Models\User;
use App\Services\ActivityLogger;
use Illuminate\Validation\ValidationException;
class TransferService
@@ -24,6 +25,7 @@ class TransferService
}
$fromDepartmentId = $feedback->current_department_id;
$fromDepartmentName = $feedback->currentDepartment?->name ?? 'N/A';
$log = TicketTransferLog::create([
'feedback_id' => $feedback->id,
@@ -40,6 +42,22 @@ class TransferService
$this->notifyDepartmentManager($toDepartment, $feedback, $log, $sender);
ActivityLogger::log(
'transfer',
__('feedback.log_transfer', [
'title' => $feedback->title,
'from' => $fromDepartmentName,
'to' => $toDepartment->name,
]),
$feedback,
[
'feedback_id' => $feedback->id,
'from_department' => $fromDepartmentName,
'to_department' => $toDepartment->name,
'reason' => $reason,
],
);
return $log;
}