<?php

namespace App\Enums;

enum Availability: string
{
    case Weekends    = 'weekends';     // Weekends only
    case Evenings    = 'evenings';     // Evenings after work
    case Full        = 'full';         // Fully available
    case Unavailable = 'unavailable';  // Temporarily not taking work

    public function label(): string
    {
        return match($this) {
            Availability::Weekends    => 'Weekends Only',
            Availability::Evenings    => 'Evenings Only',
            Availability::Full        => 'Fully Available',
            Availability::Unavailable => 'Not Available',
        };
    }

    public function labelAr(): string
    {
        return match($this) {
            Availability::Weekends    => 'عطلة نهاية الأسبوع فقط',
            Availability::Evenings    => 'المساء فقط',
            Availability::Full        => 'متاح بالكامل',
            Availability::Unavailable => 'غير متاح',
        };
    }

    public function isAvailable(): bool
    {
        return $this !== Availability::Unavailable;
    }

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