workflow_level
This commit is contained in:
parent
5292865bef
commit
bdf1ad1ca3
@ -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)
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<td class="bg-gray-100">{{ $report->created_at }}</td>
|
||||
<td>
|
||||
<a target="_blank" href="{{ $report->viewUrl() }}">
|
||||
{{ $report->report_status->name }}
|
||||
{{ $report->workflow_level->name }}
|
||||
<i class="fa-regular fa-square-arrow-up-right ms-1"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user