import api from "src/api";

export const previewTbrCalculation = async (payload) => {
  const { data } = await api.post("/tbr-calculation/preview", payload);
  return data.payload;
};

export const previewBatchTbrCalculation = async (payload) => {
  const { data } = await api.post("/tbr-calculation/preview-batch", payload);
  return data.payload;
};

export const createTbrCalculation = async (payload) => {
  const { data } = await api.post("/tbr-calculation", payload);
  return data.payload;
};

export const generateReceivable = async (id) => {
  const { data } = await api.post(`/tbr-calculation/${id}/generate-receivable`);
  return data.payload;
};

export const generateBatchReceivables = async (payload) => {
  const { data } = await api.post("/tbr-calculation/generate-batch", payload);
  return data;
};

export const getMunicipalitySizes = async () => {
  const { data } = await api.get("/selects/municipality-sizes");
  return data.payload;
};
