<?php

namespace App\Enums;

// ══════════════════════════════════════════════════════════════════
//  InPractice — ExperienceLevel Enum
//  Location: app/Enums/ExperienceLevel.php
// ══════════════════════════════════════════════════════════════════

enum ExperienceLevel: string
{
    case Student   = 'student';    // Still studying
    case Fresh     = 'fresh';      // 0–1 years
    case Junior    = 'junior';     // 1–3 years
    case Mid       = 'mid';        // 3–5 years
    case Senior    = 'senior';     // 5–10 years
    case Senior10  = 'senior_10';  // 10–15 years
    case Senior15  = 'senior_15';  // 15–20 years
    case Senior20  = 'senior_20';  // 20+ years

    public function label(): string
    {
        return match($this) {
            ExperienceLevel::Student  => 'Student',
            ExperienceLevel::Fresh    => 'Fresh Graduate (0–1 yrs)',
            ExperienceLevel::Junior   => 'Junior (1–3 yrs)',
            ExperienceLevel::Mid      => 'Mid-Level (3–5 yrs)',
            ExperienceLevel::Senior   => 'Senior (5–10 yrs)',
            ExperienceLevel::Senior10 => '10–15 Years',
            ExperienceLevel::Senior15 => '15–20 Years',
            ExperienceLevel::Senior20 => '20+ Years',
        };
    }

    public function labelAr(): string
    {
        return match($this) {
            ExperienceLevel::Student  => 'طالب',
            ExperienceLevel::Fresh    => 'خريج حديث (0–1 سنة)',
            ExperienceLevel::Junior   => 'مبتدئ (1–3 سنوات)',
            ExperienceLevel::Mid      => 'متوسط (3–5 سنوات)',
            ExperienceLevel::Senior   => 'خبير (5–10 سنوات)',
            ExperienceLevel::Senior10 => '10–15 سنة',
            ExperienceLevel::Senior15 => '15–20 سنة',
            ExperienceLevel::Senior20 => 'أكثر من 20 سنة',
        };
    }

    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}