import { apiFetch } from "./http";
import type { PayrollReportResponse } from "./types";

export function getPayrollReport(salaryMonth = ""): Promise<PayrollReportResponse> {
  const params = new URLSearchParams();
  if (salaryMonth) {
    params.set("salary_month", salaryMonth);
  }
  const query = params.toString();
  return apiFetch<PayrollReportResponse>(`/api/reports/payroll-summary${query ? `?${query}` : ""}`);
}
