<?php

declare(strict_types=1);

namespace Kylin\Manufacturing\Enums;

/**
 * 检验结果
 */
enum InspectionResult: string
{
    case Pass = 'pass';
    case Fail = 'fail';
    case Conditional = 'conditional';

    public function label(): string
    {
        return match ($this) {
            self::Pass => '合格',
            self::Fail => '不合格',
            self::Conditional => '让步接收',
        };
    }

    public function badgeClass(): string
    {
        return match ($this) {
            self::Pass => 'bg-success',
            self::Fail => 'bg-danger',
            self::Conditional => 'bg-warning',
        };
    }
}
