import api from "src/api";

export const getPlanAccountsMe = async () => {
  const { data } = await api.get("/franchisee/financial/plan-accounts");
  return data.payload;
};

export const getPlanAccountsForSelect = async () => {
  const { data } = await api.get("/selects/financial-plan-accounts");
  return data.payload;
};

export const createPlanAccountMe = async (payload) => {
  const { data } = await api.post("/franchisee/financial/plan-accounts", payload);
  return data.payload;
};

export const updatePlanAccountMe = async (id, payload) => {
  const { data } = await api.put(`/franchisee/financial/plan-accounts/${id}`, payload);
  return data.payload;
};

export const deletePlanAccountMe = async (id) => {
  const { data } = await api.delete(`/franchisee/financial/plan-accounts/${id}`);
  return data;
};
