var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellSalesManagement/serve.ts
var serve_exports = {};
__export(serve_exports, {
  addNotesByOrder: () => addNotesByOrder,
  createNoteApis: () => createNoteApis,
  editNoteByOrder: () => editNoteByOrder,
  editOrderNote: () => editOrderNote,
  getPaymentMethods: () => getPaymentMethods,
  getRelationRecords: () => getRelationRecords,
  getRelationTables: () => getRelationTables,
  getResourceTypes: () => getResourceTypes,
  removeNoteByOrder: () => removeNoteByOrder
});
module.exports = __toCommonJS(serve_exports);
var import_utils = require("../../utils");
var getRelationTables = async (params) => {
  let { data } = await import_utils.request.getRequest().get("/shop/form/relation/table", params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var getResourceTypes = async (params) => {
  const res = await import_utils.request.getRequest().get(`/shop/schedule/resource-types`, params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return (res == null ? void 0 : res.data) || [];
};
var editOrderNote = async (orderId, params) => {
  const { data } = await import_utils.request.getRequest().put(`/shop/order/order/${orderId}/note`, params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var addNotesByOrder = async (params) => {
  const { data } = await import_utils.request.getRequest().post("/shop/schedule/event-note", params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var removeNoteByOrder = async (params) => {
  const noteId = params == null ? void 0 : params.id;
  if (noteId === void 0 || noteId === null) {
    return null;
  }
  const { data } = await import_utils.request.getRequest().remove(`/shop/schedule/event-note/${noteId}`, params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var editNoteByOrder = async (params) => {
  const noteId = params == null ? void 0 : params.id;
  if (noteId === void 0 || noteId === null) {
    return null;
  }
  const { data } = await import_utils.request.getRequest().put(`/shop/schedule/event-note/${noteId}`, params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var createNoteApis = (orderId) => {
  return {
    editOrderNote: (params) => {
      if (orderId === void 0 || orderId === null) {
        return null;
      }
      return editOrderNote(orderId, params);
    },
    addNotesByOrder,
    removeNoteByOrder,
    editNoteByOrder
  };
};
var getRelationRecords = async (params) => {
  let { data } = await import_utils.request.getRequest().get("/shop/form/relation/record", params, {
    abort: true,
    fullResult: true,
    isShopApi: true
  });
  return data;
};
var getPaymentMethods = async () => {
  const response = await import_utils.request.getRequest().get("/shop/pay/custom-payment/all", {}, {
    osServer: true
  });
  return response;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  addNotesByOrder,
  createNoteApis,
  editNoteByOrder,
  editOrderNote,
  getPaymentMethods,
  getRelationRecords,
  getRelationTables,
  getResourceTypes,
  removeNoteByOrder
});
