audit enhance

This commit is contained in:
Dr Masroor Ehsan 2025-01-22 00:24:31 +06:00
parent f767abe9f1
commit 0d2057dfd1
3 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,7 @@
use App\Http\Controllers\HashidControllerBase; use App\Http\Controllers\HashidControllerBase;
use App\Models\Study; use App\Models\Study;
use App\Services\AuditTrail\Activity;
use Closure; use Closure;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -26,6 +27,7 @@ private function loadViewer(Closure $callback)
$url = $callback($study); $url = $callback($study);
abort_if(blank($url), 404); abort_if(blank($url), 404);
$title = Str::limit($study->getPatientDemographic(), 40); $title = Str::limit($study->getPatientDemographic(), 40);
audit()->on($study)->did(Activity::Image_View)->log();
return view('staff.studies.viewer', compact('url', 'title')); return view('staff.studies.viewer', compact('url', 'title'));
} }

View File

@ -43,7 +43,7 @@ public function save(StudyHistoryRequest $request)
$details->update($payload); $details->update($payload);
audit() audit()
->did(Activity::Study_History_Update) ->did(Activity::Study_History_Edit)
->on($this->key) ->on($this->key)
->log(); ->log();

View File

@ -13,7 +13,7 @@ enum Activity: int
case Study_History_View = 104; case Study_History_View = 104;
case Study_History_Update = 105; case Study_History_Edit = 105;
case Study_Create = 106; case Study_Create = 106;
@ -29,6 +29,9 @@ enum Activity: int
case Attachment_Download = 113; case Attachment_Download = 113;
case Attachment_Delete = 114; case Attachment_Delete = 114;
// image
case Image_View = 150;
// report // report
case Report_Save = 201; case Report_Save = 201;