<?php

namespace App\Modules\HR\Leave\Services;

use App\Modules\Admin\Tenancy\Models\Tenant;
use App\Modules\HR\Leave\Repositories\LeaveTypeRepository;

class LeaveTypeBootstrapService
{
    public function __construct(
        private readonly LeaveTypeRepository $types,
    ) {}

    public function ensureDefaults(Tenant $tenant): void
    {
        $defaults = config('hr_leave.default_types', []);
        if ($defaults === []) {
            return;
        }
        $this->types->seedDefaults((int) $tenant->id, $defaults);
    }
}
