import request from './request'

export interface TaskItem {
  id: number
  name: string
  project_id: number
  status: string
  deadline?: string
  created_at: string
}

export interface TaskResultItem {
  result_id: number
  column_id: number
  column_name: string
  data_type?: string
  comment?: string
  table_name?: string
  database_name?: string
  source_name?: string
  category_id?: number
  category_name?: string
  level_id?: number
  level_name?: string
  level_color?: string
  source: string
  confidence: number
  status: string
}

export function getMyTasks(params?: { status?: string }) {
  return request.get('/tasks/my-tasks', { params })
}

export function getTaskItems(taskId: number) {
  return request.get(`/tasks/my-tasks/${taskId}/items`)
}
