From bdf1ad1ca3aef0c1efc1ba390d52693d4feb1b58 Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Wed, 29 Jan 2025 21:26:37 +0600 Subject: [PATCH] workflow_level --- app/Services/Workflow/Manager.php | 12 ++++++------ resources/views/staff/reports/popup.blade.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Services/Workflow/Manager.php b/app/Services/Workflow/Manager.php index 3d93454..ecd744f 100644 --- a/app/Services/Workflow/Manager.php +++ b/app/Services/Workflow/Manager.php @@ -3,7 +3,7 @@ namespace App\Services\Workflow; use App\Domain\ACL\Permission; -use App\Domain\Report\ReportStatus; +use App\Domain\Study\WorkflowLevel; use App\Models\Study; use App\Models\User; use Closure; @@ -42,28 +42,28 @@ public function can(Permission $permission): bool public function canAssignPhysician(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canStudyHistoryEdit(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canAttachmentUpload(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canReportDownload(): bool { - return $this->activeStudy(fn () => $this->study->report_status >= ReportStatus::Finalized); + return $this->activeStudy(fn () => $this->study->workflow_level >= WorkflowLevel::Finalized); } public function canReportEdit(): bool { return $this->activeStudy(fn () => $this->study->isUnlocked() && - $this->study->report_status <= ReportStatus::Preliminary && + $this->study->workflow_level <= WorkflowLevel::DraftAvailable && $this->study->isAssignedTo($this->user) ); } diff --git a/resources/views/staff/reports/popup.blade.php b/resources/views/staff/reports/popup.blade.php index 80a9ca0..933943f 100644 --- a/resources/views/staff/reports/popup.blade.php +++ b/resources/views/staff/reports/popup.blade.php @@ -4,7 +4,7 @@ {{ $report->created_at }} - {{ $report->report_status->name }} + {{ $report->workflow_level->name }}