chore: update document approval workflow and bug fixes
This commit is contained in:
37
Modules/ProjectManagement/app/Enums/ProjectStatus.php
Normal file
37
Modules/ProjectManagement/app/Enums/ProjectStatus.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\ProjectManagement\Enums;
|
||||
|
||||
enum ProjectStatus: string
|
||||
{
|
||||
case UnderBidding = 'under_bidding';
|
||||
case Planning = 'planning';
|
||||
case InProgress = 'in_progress';
|
||||
case OnHold = 'on_hold';
|
||||
case Completed = 'completed';
|
||||
case Closed = 'closed';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::UnderBidding => 'Under Bidding',
|
||||
self::Planning => 'Planning',
|
||||
self::InProgress => 'In Progress',
|
||||
self::OnHold => 'On Hold',
|
||||
self::Completed => 'Completed',
|
||||
self::Closed => 'Closed',
|
||||
};
|
||||
}
|
||||
|
||||
public function allowedTransitions(): array
|
||||
{
|
||||
return match ($this) {
|
||||
self::UnderBidding => [self::Planning, self::Closed],
|
||||
self::Planning => [self::InProgress, self::OnHold, self::Closed],
|
||||
self::InProgress => [self::OnHold, self::Completed],
|
||||
self::OnHold => [self::InProgress, self::Closed],
|
||||
self::Completed => [self::Closed],
|
||||
self::Closed => [],
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user