<?php

namespace App\Modules\HR\Employees\Enums;

enum EmployeeDocumentType: string
{
    case Photo = 'photo';
    case Cv = 'cv';
    case NationalIdFront = 'national_id_front';
    case NationalIdBack = 'national_id_back';
    case Passport = 'passport';
    case Contract = 'contract';
    case Certificate = 'certificate';
    case Residency = 'residency';
    case Visa = 'visa';
    case WorkPermit = 'work_permit';

    /** @return list<string> */
    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }

    /** @return list<self> */
    public static function expiryTracked(): array
    {
        return [
            self::NationalIdFront,
            self::Passport,
            self::Contract,
            self::Residency,
            self::Visa,
            self::WorkPermit,
        ];
    }

    public function tracksExpiry(): bool
    {
        return in_array($this, self::expiryTracked(), true);
    }
}
