import { m as s } from "./app-Bpb4394e.js";
import { useCoreStore as c } from "@feedmepos/mf-common";
const u = s((n, a) => {
  function o() {
    var t;
    return `business_${((t = c().currentBusiness.value) == null ? void 0 : t._id) ?? ""}`;
  }
  return {
    async getTemplate(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template/${e}`;
      return a.get(t);
    },
    async getTemplateBySupplierId(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template?supplierId=${e}`;
      return a.get(t);
    },
    async readTemplates() {
      const e = o(), r = `${n.inventoryBackendUrl}/${e}/purchase-order-template`;
      return a.get(r);
    },
    async createTemplate(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template`;
      return a.post(t, e);
    },
    async updateTemplate(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template`;
      return a.put(t, e);
    },
    async deleteTemplate(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template`;
      return a.delete(t, { _id: e._id, _rev: e._rev });
    },
    async importTemplates(e) {
      const r = o(), t = `${n.inventoryBackendUrl}/${r}/purchase-order-template/import`;
      return a.post(t, e);
    }
  };
});
export {
  u
};
