diff --git a/app/Services/AuditTrail/ActivityLogger.php b/app/Services/AuditTrail/ActivityLogger.php index 5e3861a..60c5268 100644 --- a/app/Services/AuditTrail/ActivityLogger.php +++ b/app/Services/AuditTrail/ActivityLogger.php @@ -27,14 +27,14 @@ public function __construct() $this->category = Category::GENERAL; } - public function performedOn(Study $study): static + public function on(Study $study): static { $this->studyId = $study->id; return $this; } - public function causedBy(Authenticatable|int $user): static + public function by(Authenticatable|int $user): static { if ($user == null) { return $this; @@ -77,9 +77,9 @@ public function notes(string $notes): static return $this; } - public function withAgent(): static + public function ua(?string $agent = null): static { - $this->userAgent = request()->userAgent(); + $this->userAgent = $agent ?? request()->userAgent(); return $this; } diff --git a/app/Services/AuditTrail/Category.php b/app/Services/AuditTrail/Category.php index 9e50c4a..7bbaad1 100644 --- a/app/Services/AuditTrail/Category.php +++ b/app/Services/AuditTrail/Category.php @@ -4,5 +4,11 @@ final class Category { - public const int GENERAL = 1; + public const int GENERAL = 10; + + public const int SYSTEM = 20; + + public const int PACS = 30; + + public const int AUTH = 40; }