<?php

declare(strict_types=1);

namespace App\Enums;

/**
 * The trust signals an account can accumulate (spec section 22). Each maps to a
 * public badge; the underlying evidence stays private.
 */
enum UserVerificationType: string
{
    case Email = 'email';
    case Phone = 'phone';
    case Identity = 'identity';
    case Payment = 'payment';
    case Business = 'business';

    public function label(): string
    {
        return match ($this) {
            self::Email => 'Email verified',
            self::Phone => 'Phone verified',
            self::Identity => 'Identity verified',
            self::Payment => 'Payment verified',
            self::Business => 'Business verified',
        };
    }

    /**
     * Whether a verified badge of this type may be shown publicly. Identity
     * checks are surfaced as a badge only -- never the documents behind them.
     */
    public function isPubliclyVisible(): bool
    {
        return true;
    }

    /** Whether reaching `verified` requires a human or third-party review. */
    public function requiresReview(): bool
    {
        return in_array($this, [self::Identity, self::Business], true);
    }
}
