ldc-cocotte/domain/Enums/OrderStatus.php

34 lines
790 B
PHP
Raw Permalink Normal View History

2026-06-14 21:32:07 +02:00
<?php
declare(strict_types=1);
namespace Domain\Enums;
use Shared\Enums\BaseEnum;
use Shared\Enums\HasBaseEnum;
2026-06-14 21:32:07 +02:00
enum OrderStatus: string implements HasBaseEnum
2026-06-14 21:32:07 +02:00
{
/** @use \Shared\Enums\BaseEnum<string> */
2026-06-14 21:32:07 +02:00
use BaseEnum;
case WAITING = 'waiting';
case PENDING = 'pending';
case VALIDATED = 'validated';
case FAILED = 'failed';
case CANCELED = 'canceled';
2026-06-14 21:32:07 +02:00
/**
* Optional labels definition
*
* @phpstan-ignore-next-line classConstant.unused (Base enum usage)
2026-06-14 21:32:07 +02:00
*/
private const LABELS = [
self::WAITING->name => 'En attente',
self::PENDING->name => 'En cours',
self::VALIDATED->name => 'Validée',
self::FAILED->name => 'Échouée',
self::CANCELED->name => 'Annulée',
2026-06-14 21:32:07 +02:00
];
}