<?php

namespace App\Modules\HR\Recruitment\Support;

final class OfferLetterStatus
{
    public const DRAFT = 'draft';

    public const UNDER_REVIEW = 'under_review';

    public const APPROVED = 'approved';

    public const SENT = 'sent';

    public const ACCEPTED = 'accepted';

    public const HIRED = 'hired';

    public const REJECTED = 'rejected';

    public const EXPIRED = 'expired';

    public const WITHDRAWN = 'withdrawn';

    /** @return list<string> */
    public static function all(): array
    {
        return [
            self::DRAFT,
            self::UNDER_REVIEW,
            self::APPROVED,
            self::SENT,
            self::ACCEPTED,
            self::HIRED,
            self::REJECTED,
            self::EXPIRED,
            self::WITHDRAWN,
        ];
    }

    /** @return list<string> */
    public static function terminal(): array
    {
        return [self::ACCEPTED, self::HIRED, self::REJECTED, self::EXPIRED, self::WITHDRAWN];
    }

    /** @return list<string> */
    public static function editable(): array
    {
        return [self::DRAFT];
    }

    /** @return list<string> */
    public static function withdrawable(): array
    {
        return [self::DRAFT, self::UNDER_REVIEW, self::APPROVED, self::SENT];
    }

    public static function isAccepted(string $status): bool
    {
        return $status === self::ACCEPTED;
    }
}
