File: /www/wwwroot/erp.nhatnamsst.com/domains/Core/Enums/DebtStatus.php
<?php
namespace Domains\Core\Enums;
use Domains\Core\Supports\Enum;
enum DebtStatus: int
{
use Enum;
case UNPAID = 1; // Chưa thanh toán
case PARTIALLY_PAID = 2; // Đang thanh toán
case COMPLETED = 3; // Hoàn thành
public function badge(): string
{
return match($this) {
self::UNPAID => 'bg-danger text-white', // Red
self::PARTIALLY_PAID => 'bg-warning text-white', // Yellow
self::COMPLETED => 'bg-success text-white', // Green
};
}
public function label(): string
{
return match ($this) {
self::UNPAID => 'Chưa thanh toán',
self::PARTIALLY_PAID => 'Đang thanh toán',
self::COMPLETED => 'Hoàn thành',
};
}
}