update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
@@ -0,0 +1,52 @@
<?php
namespace App\Http\Controllers\Api\Admin\Customer\Concerns;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
trait ManagesCustomerNotes
{
public function getCustomerNotes(string $uuid): JsonResponse
{
return response()->json(['error' => false, 'data' => $this->noteService->getCustomerNotes($uuid)]);
}
public function storeCustomerNote(string $uuid, Request $request): JsonResponse
{
$data = $request->validate(['note' => 'required|string']);
$note = $this->noteService->storeCustomerNote($uuid, $data['note'], Auth::id());
return response()->json(['error' => false, 'message' => 'Đã thêm ghi chú', 'data' => $note]);
}
public function destroyCustomerNote(string $uuid, int $noteId): JsonResponse
{
$this->noteService->destroyNote($uuid, $noteId);
return response()->json(['error' => false, 'message' => 'Đã xoá ghi chú']);
}
public function getServiceNotes(string $uuid, int $serviceId): JsonResponse
{
return response()->json(['error' => false, 'data' => $this->noteService->getServiceNotes($uuid, $serviceId)]);
}
public function storeServiceNote(string $uuid, int $serviceId, Request $request): JsonResponse
{
$data = $request->validate(['note' => 'required|string']);
$note = $this->noteService->storeServiceNote($uuid, $serviceId, $data['note'], Auth::id());
return response()->json(['error' => false, 'message' => 'Đã thêm ghi chú', 'data' => $note]);
}
public function destroyServiceNote(string $uuid, int $serviceId, int $noteId): JsonResponse
{
$this->noteService->destroyNote($uuid, $noteId);
return response()->json(['error' => false, 'message' => 'Đã xoá ghi chú']);
}
}