import api from "src/api";

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

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

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

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