<?php

declare(strict_types=1);

namespace apexl\Io\modules\user\enums;

/**
 * The outcome of evaluating a user against the platform 2FA mode + their own
 * enrolment state. Shared by TwoFactorGateAction (login) and TwoFactorMiddleware
 * (per-request), and mapped to the frontend-facing `two_factor_status` string.
 */
enum TwoFactorGateDecision: string
{
    /** No second factor required — pass straight through. */
    case NONE = 'none';

    /** User has an active method and must enter a code (or recovery code). */
    case CHALLENGE = 'challenge';

    /** Enforced mode, user has no active method yet — must enrol before proceeding. */
    case SETUP_REQUIRED = 'setup_required';

    public function requiresGate(): bool
    {
        return $this !== self::NONE;
    }
}
