<?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';
    case Nda = 'nda';
    case MedicalReport = 'medical_report';
    case DrivingLicense = 'driving_license';
    case Insurance = 'insurance';

    /** @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,
            self::MedicalReport,
            self::DrivingLicense,
            self::Insurance,
        ];
    }

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