<?php

namespace App\Modules\HR\EmploymentStatuses\Services;

use App\Modules\Admin\Tenancy\Models\Tenant;
use App\Modules\HR\EmploymentStatuses\Repositories\EmploymentStatusRepository;

final class EmploymentStatusBootstrapService
{
    public function __construct(
        private readonly EmploymentStatusRepository $statuses,
    ) {}

    public function ensureDefaults(Tenant $tenant): void
    {
        $defaults = config('hr_employment_statuses.defaults', []);
        if ($defaults === []) {
            return;
        }

        $this->statuses->seedDefaults((int) $tenant->id, $defaults);
    }
}
