<?php

declare(strict_types=1);

namespace Kylin\RiskEngine\Enums;

/**
 * 风控决策结果
 */
enum RiskDecision: string
{
    case PASS          = 'pass';           // 放行
    case OBSERVE       = 'observe';        // 观察
    case FACE_REQUIRED = 'face_required';  // 触发人脸复核
    case LOCKOUT       = 'lockout';        // 临时锁定

    public function label(): string
    {
        return match ($this) {
            self::PASS          => '放行',
            self::OBSERVE       => '观察',
            self::FACE_REQUIRED => '需人脸复核',
            self::LOCKOUT       => '临时锁定',
        };
    }

    public function isBlocked(): bool
    {
        return in_array($this, [self::FACE_REQUIRED, self::LOCKOUT], true);
    }
}
