import request from "@/utils/httpRequest";
import { PSI_MANAGEMANT as prefix } from "../AppPath";
import DishMenuService from "./DishMenuService";

export default class DishOrderService {
	constructor() {
		this.dishMenuService = new DishMenuService();
	}
	typeList() {
		return this.dishMenuService.orderTypeList();
	}
	dishList(param) {
		return this.dishMenuService.orderDishList(param);
	}
	currentOrder(roomId) {
		return request({
			url: prefix + "/psi/dishOrder/currentOrder",
			method: "get",
			params: { roomId: roomId },
		});
	}
	submit(param) {
		return request({
			url: prefix + "/psi/dishOrder/submit",
			method: "post",
			data: param,
		});
	}
	cancelOrder(id) {
		return request({
			url: prefix + "/psi/dishOrder/cancelOrder",
			method: "get",
			params: { id: id },
		});
	}
	orderList(param) {
		return request({
			url: prefix + "/psi/dishOrder/orderList",
			method: "get",
			params: param,
		});
	}
	exportFile(param) {
		return request({
			url: prefix + "/psi/dishOrder/exportFile",
			method: "get",
			params: param,
			responseType: "blob",
		});
	}
	findOrderById(id) {
		return request({
			url: prefix + "/psi/dishOrder/findOrderById",
			method: "get",
			params: { id: id },
		});
	}
}
