import api from "src/api";

export const getFinancialPlanAccounts = async (params = {}) => {
  const { data } = await api.get("/financial-plan-account", { params });
  return data.payload;
};

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

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

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

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