import type { createMaintainOrderType, WorkOrdersListType } from './types/work'
import { http } from '@/http/http'

// 分页查询工单信息
export function queryhWorkOrders(query: WorkOrdersListType) {
  return http.get('/operations/ebikeBikeOrder/page', query)
}

// 工单详情
export function queryWorkOrderDetailAPI(orderId: string) {
  return http.get(`/operations/ebikeBikeOrder/getInfo`, { orderId })
}

// 接取工单
export function acceptWorkOrderAPI(orderId: string) {
  return http.get(`/operations/ebikeBikeOrder/acceptOrder`, { orderId })
}

// 分页查询当前员工接取的工单信息
export function queryMyWorkOrders(query: WorkOrdersListType) {
  return http.get('/operations/ebikeBikeOrder/pageByStaff', query)
}

// 生成维修工单。
export function createMaintainOrderAPI(data: createMaintainOrderType) {
  return http.post('/operations/ebikeBikeOrder/faultOrder', data)
}
