import api from "src/api";

export const getCompanyPayables = async (params = {}) => {
  const { data } = await api.get("/company-payable", { params });
  return data.payload;
};

export const createCompanyPayable = async (payload) => {
  const { data } = await api.post("/company-payable", payload);
  return data.payload;
};

export const settleCompanyPayable = async (id, payload = {}) => {
  const { data } = await api.post(`/company-payable/${id}/settle`, payload);
  return data.payload;
};

export const reopenCompanyPayable = async (id) => {
  const { data } = await api.post(`/company-payable/${id}/reopen`);
  return data.payload;
};
