67 lines
1.7 KiB
PHP
67 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Enums\Tickets;
|
|
|
|
use App\Traits\Enums\BaseEnum;
|
|
|
|
enum TicketStatusEnum: int
|
|
{
|
|
use BaseEnum;
|
|
|
|
case new = 1;
|
|
case estimateTodo = 2;
|
|
case takenInAccount = 3;
|
|
case waiting = 4;
|
|
case waitingValidation = 5;
|
|
case recette = 6;
|
|
case production = 7;
|
|
case archived = 8;
|
|
|
|
/**
|
|
* Optionnal labels definition
|
|
*/
|
|
private const LABELS = [
|
|
self::new->name => "Nouveau",
|
|
self::estimateTodo->name => "Devis à faire",
|
|
self::takenInAccount->name => "Pris en compte",
|
|
self::waiting->name => "En attente de réponse",
|
|
self::waitingValidation->name => "En attente de validation",
|
|
self::recette->name => "En recettage",
|
|
self::production->name => "En production",
|
|
self::archived->name => "Archivé",
|
|
];
|
|
|
|
/**
|
|
* Custom added classes definition
|
|
*/
|
|
private const CLASSES = [
|
|
self::new->name => 'text-danger',
|
|
self::estimateTodo->name => 'text-info',
|
|
self::takenInAccount->name => 'text-info',
|
|
self::waiting->name => 'text-white bg-danger',
|
|
self::waitingValidation->name => 'text-warning bg-danger',
|
|
self::recette->name => 'text-primary',
|
|
self::production->name => 'text-success',
|
|
self::archived->name => 'text-secondary',
|
|
];
|
|
|
|
/**
|
|
* Get Class
|
|
*
|
|
* @return string
|
|
*/
|
|
public function class(): string
|
|
{
|
|
return self::CLASSES[$this->name];
|
|
}
|
|
|
|
/**
|
|
* Get enum classes
|
|
*
|
|
* @return array<string>
|
|
*/
|
|
public static function toClasses(): array
|
|
{
|
|
return self::CLASSES;
|
|
}
|
|
}
|