import request from "../base/request";
// 获取用户订单列表
const userOrderList = (args) => {
  return request.post("/hotelBiz/order/userOrderList", args);
};

// 获取用户订单列表
const userWorkOrderList = (args) => {
  return request.post("/hotelBiz/workOrder/userWorkOrderList", args);
};

/// 获取工单类型
const workOrderTypeListForBiz = () => {
    return request.get('/hotelBiz/workOrder/workOrderTypeListForBiz', {});
}

/// 创建工单
const createWorkOrder = (args) => {
	return request.post('/hotelBiz/workOrder/createWorkOrder', args);
}

// 获取订单详情
const userOrderDetail = (args) => {
  return request.post("/hotelBiz/order/userOrderDetail", args);
};

// 预下单
const preOrder = (args) => {
  return request.post("/hotelBiz/trade/preOrder", args);
};

// 订单取消
const orderCancel = (args) => {
  return request.post("/hotelBiz/trade/cancelRefund", args);
};

// 申请退款
const orderRefund = (args) => {
  return request.post("/hotelBiz/trade/applyRefund", args);
};

// 未支付订单立即支付
const orderPayNow = (args) => {
  return request.post("/hotelBiz/trade/applyPay", args);
};

export {
  userOrderList,
  userWorkOrderList,
  workOrderTypeListForBiz,
  createWorkOrder,
  userOrderDetail,
  preOrder,
  orderCancel,
  orderRefund,
  orderPayNow,
};
