<?php

declare(strict_types=1);

namespace Kylin\Hr\Enums;

/**
 * 审批状态枚举
 */
enum ApprovalStatus: int
{
    case Pending = 1;    // 待审批
    case Approved = 2;   // 已通过
    case Rejected = 3;   // 已拒绝
    case Cancelled = 4;  // 已撤销

    /**
     * 获取标签
     */
    public function label(): string
    {
        return match ($this) {
            self::Pending   => '待审批',
            self::Approved  => '已通过',
            self::Rejected  => '已拒绝',
            self::Cancelled => '已撤销',
        };
    }

    /**
     * 获取颜色
     */
    public function color(): string
    {
        return match ($this) {
            self::Pending   => 'warning',
            self::Approved  => 'success',
            self::Rejected  => 'danger',
            self::Cancelled => 'secondary',
        };
    }
}
