export type JobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';

export type JobStepStatus = 'pending' | 'running' | 'completed' | 'failed';

export type JobProgress = {
  current: number;
  total: number;
  label?: string;
};

export type JobStep = {
  name: string;
  status: JobStepStatus;
  startedAt?: number;
  completedAt?: number;
  error?: string;
  progress?: JobProgress;
};

export type Job = {
  id: string;
  lane: string;
  type: string;
  userId: string;
  status: JobStatus;
  steps: JobStep[];
  currentStep: number;
  error?: string;
  createdAt: number;
  startedAt?: number;
  completedAt?: number;
  meta?: Record<string, unknown>;
};
