<?php

namespace App\Domain\Document\Enums;

enum DocumentType: string
{
    case BirthCertificate = 'birth_certificate';
    case NationalId = 'national_id';
    case MedicalCertificate = 'medical_certificate';
    case Passport = 'passport';
    case Photo = 'photo';
    case Contract = 'contract';
    case Qualification = 'qualification';
    case Insurance = 'insurance';
    case Other = 'other';

    public function label(): string
    {
        return match ($this) {
            self::BirthCertificate => 'شهادة الميلاد',
            self::NationalId => 'بطاقة الرقم القومي',
            self::MedicalCertificate => 'الشهادة الطبية',
            self::Passport => 'جواز السفر',
            self::Photo => 'صورة شخصية',
            self::Contract => 'عقد',
            self::Qualification => 'مؤهل / شهادة',
            self::Insurance => 'تأمين',
            self::Other => 'أخرى',
        };
    }

    public function requiresExpiry(): bool
    {
        return match ($this) {
            self::MedicalCertificate, self::Insurance => true,
            default => false,
        };
    }

    public function requiresApproval(): bool
    {
        return match ($this) {
            self::MedicalCertificate => true,
            default => false,
        };
    }
}
