import { m as c } from "./app-Bpb4394e.js";
import { useCoreStore as u } from "@feedmepos/mf-common";
const d = c((s, a) => {
  function r() {
    var n;
    return `business_${((n = u().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
  }
  return {
    async getRecentPublishingJob() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/adjustment-template/publish/recent`;
      return a.get(t);
    },
    async startNewPublish() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/adjustment-template/publish`;
      return a.post(t);
    },
    async getRecentPublishInfo() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/adjustment-template/publish`;
      return a.get(t);
    },
    async publishSingleDoc(e, t) {
      const n = r(), o = `${s.inventoryBackendUrl}/${n}/adjustment-template/publish/${e}`;
      return a.post(o, { locationDbNames: t });
    },
    async unpublishSingleDoc(e, t) {
      const n = r(), o = `${s.inventoryBackendUrl}/${n}/adjustment-template/unpublish/${e}`;
      return a.post(o, { locationDbNames: t });
    },
    async getTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template/${e}`;
      return a.get(n);
    },
    async readTemplates() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/adjustment-template`;
      return a.get(t);
    },
    async createTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template`;
      return a.post(n, e);
    },
    async updateTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template`;
      return a.put(n, e);
    },
    async deleteTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template`;
      return a.delete(n, { _id: e._id, _rev: e._rev });
    },
    async importTemplates(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template/import`;
      return a.post(n, e);
    },
    async getReasons() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/adjustment-template/reason`;
      return a.get(t);
    },
    async update(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template/reason`;
      return a.post(n, e);
    },
    async publishReasonDoc(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template/publish/reason`;
      return a.post(n, { locationDbNames: e });
    },
    async getAuditTrails(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/adjustment-template/${e}/audit-trails`;
      return a.get(n);
    }
  };
}), p = c((s, a) => {
  function r() {
    var n;
    return `business_${((n = u().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
  }
  return {
    async getRecentPublishingJob() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/closing-template/publish/recent`;
      return a.get(t);
    },
    async startNewPublish() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/closing-template/publish`;
      return a.post(t);
    },
    async getRecentPublishInfo() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/closing-template/publish`;
      return a.get(t);
    },
    async publishSingleDoc(e, t) {
      const n = r(), o = `${s.inventoryBackendUrl}/${n}/closing-template/publish/${e}`;
      return a.post(o, { locationDbNames: t });
    },
    async unpublishSingleDoc(e, t) {
      const n = r(), o = `${s.inventoryBackendUrl}/${n}/closing-template/unpublish/${e}`;
      return a.post(o, { locationDbNames: t });
    },
    async getTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template/${e}`;
      return a.get(n);
    },
    async readTemplates() {
      const e = r(), t = `${s.inventoryBackendUrl}/${e}/closing-template`;
      return a.get(t);
    },
    async createTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template`;
      return a.post(n, e);
    },
    async updateTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template`;
      return a.put(n, e);
    },
    async deleteTemplate(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template`;
      return a.delete(n, { _id: e._id, _rev: e._rev });
    },
    async importTemplates(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template/import`;
      return a.post(n, e);
    },
    async getAuditTrails(e) {
      const t = r(), n = `${s.inventoryBackendUrl}/${t}/closing-template/${e}/audit-trails`;
      return a.get(n);
    }
  };
});
export {
  p as a,
  d as u
};
