import apiClient from "./apiClient";

export const createPayroll = async (data) => {
  const response = await apiClient.post("/payrolls", data);
  return response.data;
};

export const getPayrolls = async (params) => {
  const response = await apiClient.get("/payrolls", { params });
  return response.data;
};

export const getPayroll = async (id) => {
  const response = await apiClient.get(`/payrolls/${id}`);
  return response.data;
};

export const updatePayroll = async (id, data) => {
  const response = await apiClient.put(`/payrolls/${id}`, data);
  return response.data;
};

export const deletePayroll = async (id) => {
  const response = await apiClient.delete(`/payrolls/${id}`);
  return response.data;
};
