<?php

namespace App\Modules\HR\Recruitment\Support;

use Illuminate\Validation\ValidationException;

/**
 * Guards hiring flows until an offer is accepted (Phase 3+).
 */
final class OfferLetterHiringGate
{
    public static function assertAccepted(string $status): void
    {
        if (! OfferLetterStatus::isAccepted($status)) {
            throw ValidationException::withMessages([
                'status' => __('recruitment.offer_letters.errors.hiring_requires_accepted'),
            ]);
        }
    }
}
