35 lines
859 B
PHP
35 lines
859 B
PHP
<?php
|
|
|
|
namespace App\Model;
|
|
|
|
final class TraceStatus
|
|
{
|
|
public const string PENDING = 'pending';
|
|
public const string IN_PROGRESS = 'in-progress';
|
|
public const string SUCCESS = 'success';
|
|
public const string FAILED = 'failed';
|
|
public const string CANCELLED = 'cancelled';
|
|
|
|
private const array STATUS = [
|
|
self::PENDING => 'Pendiente',
|
|
self::IN_PROGRESS => 'En progreso',
|
|
self::SUCCESS => 'Finalizado con éxito',
|
|
self::FAILED => 'Fallido',
|
|
self::CANCELLED => 'Cancelado',
|
|
];
|
|
|
|
public static function getStatus(): array
|
|
{
|
|
return self::STATUS;
|
|
}
|
|
|
|
public static function getTraceStatus(string $status): ?string
|
|
{
|
|
return self::STATUS[$status] ?? null;
|
|
}
|
|
|
|
public static function getStatusKeys(): array
|
|
{
|
|
return array_keys(self::STATUS);
|
|
}
|
|
} |