import api from "src/api";

export const getTbrs = async () => {
  const { data } = await api.get("/tbr");
  return data.payload;
};

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

export const updateTbr = async (id, payload) => {
  const { data } = await api.put(`/tbr/${id}`, payload);
  return data.payload;
};

export const getLatestTbr = async () => {
  const { data } = await api.get("/tbr/current");
  return data.payload;
};

export const getTbrBillingPreview = async () => {
  const { data } = await api.get("/tbr-billing-preview");
  return data.payload;
};
