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

export interface JobError {
  message?: string;
}

export interface JobRowError {
  fila?: number;
  error?: string;
}

export interface JobResult {
  ok?: boolean;
  mensaje?: string;
  activos?: number | null;
  antiguos?: number | null;
  referencia?: number | null;
  cubiertosActivos?: number | null;
  total?: number | null;
  insertados?: number | null;
  actualizados?: number | null;
  omitidos?: number | null;
  omitidas?: number | null;
  desactivados?: number | null;
  duplicados?: number | null;
  creadas?: number | null;
  sin_paciente?: number | null;
  sin_cups?: number | null;
  sin_ips?: number | null;
  cups_no_cubiertos?: number | null;
  ips_sin_convenio?: number | null;
  errores?: JobRowError[];
  downloadUrl?: string;
  fileName?: string;
  contentType?: string;
}

export interface JobResponse {
  id: string;
  type: string;
  status: JobStatus;
  createdAt?: string;
  startedAt?: string;
  finishedAt?: string;
  result?: JobResult | null;
  error?: JobError | null;
}
