<?php

declare(strict_types=1);

namespace App\Support\Onboarding;

enum OnboardingDraftStage: string
{
    case Identify = 'identify';
    case ConnectProvider = 'connect-provider';
    case VerifyAccess = 'verify-access';
    case Bootstrap = 'bootstrap';
    case Review = 'review';
    case Completed = 'completed';
    case Cancelled = 'cancelled';

    public function label(): string
    {
        return match ($this) {
            self::Identify => 'Identify managed environment',
            self::ConnectProvider => 'Connect provider',
            self::VerifyAccess => 'Verify access',
            self::Bootstrap => 'Bootstrap',
            self::Review => 'Review',
            self::Completed => 'Completed',
            self::Cancelled => 'Cancelled',
        };
    }

    public function wizardStep(): int
    {
        return match ($this) {
            self::Identify => 1,
            self::ConnectProvider => 2,
            self::VerifyAccess => 3,
            self::Bootstrap => 4,
            self::Review, self::Completed, self::Cancelled => 5,
        };
    }
}
