/**
 * Data Import API Types - Mirror backend schemas
 */

export interface ImportValidationRequest {
  tenant_id: string;
  data?: string;
  data_format?: 'json' | 'csv';
}

export interface ImportValidationResponse {
  is_valid: boolean;
  total_records: number;
  valid_records: number;
  invalid_records: number;
  errors: Array<Record<string, any>>;
  warnings: Array<Record<string, any>>;
  summary: Record<string, any>;
  unique_products: number;
  product_list: string[];
  message: string;
  details: {
    total_records: number;
    format: string;
  };
  sample_records?: any[]; // Keep for backward compatibility
}

export interface ImportProcessRequest {
  tenant_id: string;
  data?: string;
  data_format?: 'json' | 'csv';
  options?: {
    skip_validation?: boolean;
    chunk_size?: number;
  };
}

export interface ImportProcessResponse {
  success: boolean;
  message: string;
  records_processed: number;
  records_failed: number;
  import_id?: string;
  errors?: string[];
  import_summary?: {
    total_records: number;
    successful_imports: number;
    failed_imports: number;
    processing_time_seconds: number;
    timestamp: string;
  };
  details?: {
    tenant_id: string;
    file_name?: string;
    processing_status: string;
  };
}

export interface ImportStatusResponse {
  import_id: string;
  status: 'pending' | 'processing' | 'completed' | 'failed';
  progress_percentage: number;
  records_processed: number;
  records_failed: number;
  started_at: string;
  completed_at?: string;
  errors?: string[];
}