import axios from './axios'

export function getOrderTree() {
  return axios.get('platform/platformWorkOrder/saas/findStateGroupList')
}

export function workConfirmed(id) {
  return axios.post('platform/platformWorkOrder/confirmed', {
    id: id,
  })
}

export function workAssigned(id, user) {
  return axios.post('platform/platformWorkOrder/assign', {
    id: id,
    leaders: user,
  })
}

export function startWorder(id, estimateCompleteTime) {
  return axios.post('platform/platformWorkOrder/start', {
    id: id,
    estimateCompleteTime: estimateCompleteTime,
  })
}

export function archiveWorkOrder(id) {
  return axios.post('platform/platformWorkOrder/archive', {
    id: id,
  })
}

export function completeWorkOrder(id) {
  return axios.post('platform/platformWorkOrder/complete', {
    id: id,
  })
}

export function replyTocustomer(id, msg) {
  return axios.post('platform/platformWorkOrderChat/add', {
    msg: msg,
    workOrderId: id,
  })
}

export function getOrderType() {
  return axios.get('platform/platformWorkOrder/orderTypeList')
}
