import api from "src/api";

export const getPayablesMe = async (params = {}) => {
  const { data } = await api.get("/franchisee/financial/payables", { params });
  return data.payload;
};

export const createPayableMe = async (payload) => {
  const { data } = await api.post("/franchisee/financial/payables", payload);
  return data.payload;
};

export const settlePayableMe = async (id, payload = {}) => {
  const { data } = await api.post(`/franchisee/financial/payables/${id}/settle`, payload);
  return data.payload;
};

export const reopenPayableMe = async (id) => {
  const { data } = await api.post(`/franchisee/financial/payables/${id}/reopen`);
  return data.payload;
};
