import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/merchant/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/merchant/order/' + orderId,
    method: 'get'
  })
}

// 商家派单
export function dispatchOrder(data) {
  return request({
    url: '/merchant/order/dispatch',
    method: 'post',
    data: data
  })
}

// 查询订单流转记录
export function getOrderFlow(orderId) {
  return request({
    url: '/merchant/order/flow/' + orderId,
    method: 'get'
  })
}

// 查询待派单订单列表
export function listPendingOrder(query) {
  return request({
    url: '/merchant/order/pending',
    method: 'get',
    params: query
  })
}

// 获取可派单的代练列表
export function getAvailablePlayers(orderId) {
  return request({
    url: '/merchant/order/available-players/' + orderId,
    method: 'get'
  })
}
