<?php

namespace App\Modules\HR\Leave\Services;

use App\Modules\Admin\Tenancy\Models\Tenant;
use App\Modules\HR\Leave\Repositories\LeaveBalanceRepository;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;

class LeaveBalancePageService
{
    public function __construct(
        private readonly LeaveBalanceRepository $balances,
    ) {}

    public function paginate(Tenant $tenant, ?int $employeeId, int $year): LengthAwarePaginator
    {
        return $this->balances->paginateForTenant((int) $tenant->id, $employeeId, $year);
    }
}
