Track machine counters and maintenance with counter and time intervals
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Machines\Domain\Enums;
|
||||
|
||||
/**
|
||||
* The state of a maintenance item (spec 19.5): in order, maintenance
|
||||
* coming up (past the advance warning), or late (a maintenance request).
|
||||
*/
|
||||
enum MaintenanceLevel: string
|
||||
{
|
||||
case Ok = 'ok';
|
||||
case Approaching = 'approaching';
|
||||
case Overdue = 'overdue';
|
||||
|
||||
public function rank(): int
|
||||
{
|
||||
return match ($this) {
|
||||
self::Ok => 0,
|
||||
self::Approaching => 1,
|
||||
self::Overdue => 2,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user