/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 商家同意退款 POST /app/merchantOrder/agreeRefund */
export async function appMerchantOrderAgreeRefundPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderAgreeRefundPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/agreeRefund', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 商家点击已送达 POST /app/merchantOrder/arrivedOrder */
export async function appMerchantOrderArrivedOrderPost({
  body,
  options,
}: {
  body: API.ArrivedOrderBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/arrivedOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 购物车下单 - 计算价格 POST /app/merchantOrder/calculatePriceCart */
export async function appMerchantOrderCalculatePriceCartPost({
  body,
  options,
}: {
  body: API.CalculatePriceCartBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RCalculatePriceCartVo>(
    '/app/merchantOrder/calculatePriceCart',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 商品下单 - 计算价格 POST /app/merchantOrder/calculatePriceDish */
export async function appMerchantOrderCalculatePriceDishPost({
  body,
  options,
}: {
  body: API.CalculatePriceDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RCalculatePriceDishVo>(
    '/app/merchantOrder/calculatePriceDish',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 用户取消订单(用户申请退款) POST /app/merchantOrder/cancelOrder */
export async function appMerchantOrderCancelOrderPost({
  body,
  options,
}: {
  body: API.CancelOrderBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/cancelOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询可用优惠券 GET /app/merchantOrder/canUseCouponList/${param0} */
export async function appMerchantOrderCanUseCouponListMerchantIdGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderCanUseCouponListmerchantIdGetParams;
  options?: CustomRequestOptions;
}) {
  const { merchantId: param0, ...queryParams } = params;

  return request<API.RListUserCouponVo>(
    `/app/merchantOrder/canUseCouponList/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 购物车下单 POST /app/merchantOrder/createOrderCart */
export async function appMerchantOrderCreateOrderCartPost({
  body,
  options,
}: {
  body: API.CreateOrderCartBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RLong>('/app/merchantOrder/createOrderCart', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 菜品下单 POST /app/merchantOrder/createOrderDish */
export async function appMerchantOrderCreateOrderDishPost({
  body,
  options,
}: {
  body: API.CreateOrderDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RLong>('/app/merchantOrder/createOrderDish', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 商家点击配送订单 POST /app/merchantOrder/deliverOrder */
export async function appMerchantOrderDeliverOrderPost({
  body,
  options,
}: {
  body: API.DeliverOrderBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/deliverOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询商家最新配送订单的五个配送员信息，根据创建时间排序排列 POST /app/merchantOrder/deliveryList */
export async function appMerchantOrderDeliveryListPost({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.RListMerchantOrderVo>('/app/merchantOrder/deliveryList', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 订单详情 POST /app/merchantOrder/detail */
export async function appMerchantOrderDetailPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderDetailPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.RMerchantOrderVo>('/app/merchantOrder/detail', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 菜品列表(根据预约时间查询) POST /app/merchantOrder/dishList */
export async function appMerchantOrderDishListPost({
  body,
  options,
}: {
  body: API.TimeSearchBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantDishVo>(
    '/app/merchantOrder/dishList',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 评价订单 POST /app/merchantOrder/evaluateOrder */
export async function appMerchantOrderEvaluateOrderPost({
  body,
  options,
}: {
  body: API.EvaluateOrderBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/evaluateOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 订单列表 POST /app/merchantOrder/orderList */
export async function appMerchantOrderOrderListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderOrderListPostParams;
  body: API.MerchantOrderListBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantOrderVo>(
    '/app/merchantOrder/orderList',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      params: {
        ...params,
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 订单付款 POST /app/merchantOrder/payOrder */
export async function appMerchantOrderPayOrderPost({
  body,
  options,
}: {
  body: API.PayOrderBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/payOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 商家接单 POST /app/merchantOrder/receiveOrder */
export async function appMerchantOrderReceiveOrderPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderReceiveOrderPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/receiveOrder', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 商家拒绝退款 POST /app/merchantOrder/rejectRefund */
export async function appMerchantOrderRejectRefundPost({
  body,
  options,
}: {
  body: API.RejectRefundBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/rejectRefund', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户自取时，商家核销订单 POST /app/merchantOrder/writeOff */
export async function appMerchantOrderWriteOffPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantOrderWriteOffPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantOrder/writeOff', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改商家订单 PUT /xjpmj/merchantOrder */
export async function xjpmjMerchantOrderPut({
  body,
  options,
}: {
  body: API.MerchantOrderBoEditGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/merchantOrder', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增商家订单 POST /xjpmj/merchantOrder */
export async function xjpmjMerchantOrderPost({
  body,
  options,
}: {
  body: API.MerchantOrderBoAddGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/merchantOrder', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取商家订单详细信息 GET /xjpmj/merchantOrder/${param0} */
export async function xjpmjMerchantOrderIdGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantOrderidGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<API.RMerchantOrderVo>(`/xjpmj/merchantOrder/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除商家订单 DELETE /xjpmj/merchantOrder/${param0} */
export async function xjpmjMerchantOrderIdsDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantOrderidsDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { ids: param0, ...queryParams } = params;

  return request<API.RVoid>(`/xjpmj/merchantOrder/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导出商家订单列表 POST /xjpmj/merchantOrder/export */
export async function xjpmjMerchantOrderExportPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantOrderExportPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.XjpmjMerchantOrderExportPostResponse>(
    '/xjpmj/merchantOrder/export',
    {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询商家订单列表 POST /xjpmj/merchantOrder/list */
export async function xjpmjMerchantOrderListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantOrderListPostParams;
  body: API.MerchantOrderListBackendBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantOrderVo>(
    '/xjpmj/merchantOrder/list',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      params: {
        ...params,
      },
      data: body,
      ...(options || {}),
    }
  );
}
