import apiClient from './client'

export interface Task {
  id: string
  type: string
  status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled'
  progress: number
  message: string
  error_message?: string
  created_by?: string
  started_at?: string
  completed_at?: string
  created_at: string
  updated_at: string
  metadata?: Record<string, any>
}

export const tasksApi = {
  getTask: async (id: string): Promise<Task> => {
    const response = await apiClient.get<Task>(`/tasks/${id}`)
    return response.data
  },
}

