import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
import { request } from "../../utils/index.js";
//#region src/plus/pisellSalesManagement/serve.ts
const getRelationTables = function() {
	var _ref = _asyncToGenerator(function* (params) {
		let { data } = yield request.getRequest().get("/shop/form/relation/table", params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function getRelationTables(_x) {
		return _ref.apply(this, arguments);
	};
}();
const getResourceTypes = function() {
	var _ref2 = _asyncToGenerator(function* (params) {
		const res = yield request.getRequest().get(`/shop/schedule/resource-types`, params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return (res === null || res === void 0 ? void 0 : res.data) || [];
	});
	return function getResourceTypes(_x2) {
		return _ref2.apply(this, arguments);
	};
}();
const editOrderNote = function() {
	var _ref3 = _asyncToGenerator(function* (orderId, params) {
		const { data } = yield request.getRequest().put(`/shop/order/order/${orderId}/note`, params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function editOrderNote(_x3, _x4) {
		return _ref3.apply(this, arguments);
	};
}();
const addNotesByOrder = function() {
	var _ref4 = _asyncToGenerator(function* (params) {
		const { data } = yield request.getRequest().post("/shop/schedule/event-note", params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function addNotesByOrder(_x5) {
		return _ref4.apply(this, arguments);
	};
}();
const removeNoteByOrder = function() {
	var _ref5 = _asyncToGenerator(function* (params) {
		const noteId = params === null || params === void 0 ? void 0 : params.id;
		if (noteId === void 0 || noteId === null) return null;
		const { data } = yield request.getRequest().remove(`/shop/schedule/event-note/${noteId}`, params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function removeNoteByOrder(_x6) {
		return _ref5.apply(this, arguments);
	};
}();
const editNoteByOrder = function() {
	var _ref6 = _asyncToGenerator(function* (params) {
		const noteId = params === null || params === void 0 ? void 0 : params.id;
		if (noteId === void 0 || noteId === null) return null;
		const { data } = yield request.getRequest().put(`/shop/schedule/event-note/${noteId}`, params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function editNoteByOrder(_x7) {
		return _ref6.apply(this, arguments);
	};
}();
const createNoteApis = (orderId) => {
	return {
		editOrderNote: (params) => {
			if (orderId === void 0 || orderId === null) return null;
			return editOrderNote(orderId, params);
		},
		addNotesByOrder,
		removeNoteByOrder,
		editNoteByOrder
	};
};
const getRelationRecords = function() {
	var _ref7 = _asyncToGenerator(function* (params) {
		let { data } = yield request.getRequest().get("/shop/form/relation/record", params, {
			abort: true,
			fullResult: true,
			isShopApi: true
		});
		return data;
	});
	return function getRelationRecords(_x8) {
		return _ref7.apply(this, arguments);
	};
}();
//#endregion
export { createNoteApis, getRelationRecords, getRelationTables, getResourceTypes };
