export interface ConnectionType {
  id: "data_save" | "external_call";
  label: string;
  description: string;
  icon: React.ReactNode;
}

export interface FieldMapping {
  id: string;
  fromField: ColumnInfo;
  toField: ColumnInfo;
  transformRule?: string;
  isValid: boolean;
  validationMessage?: string;
}

export interface ColumnInfo {
  name: string;
  type: string;
  nullable: boolean;
  primaryKey: boolean;
  foreignKey?: boolean;
  defaultValue?: any;
}

export interface TableInfo {
  name: string;
  schema: string;
  columns: ColumnInfo[];
  rowCount?: number;
}

export interface Connection {
  id: string;
  name: string;
  type: string;
  host: string;
  port: number;
  database: string;
  username: string;
  tables: TableInfo[];
}

export interface MappingStats {
  totalMappings: number;
  validMappings: number;
  invalidMappings: number;
  missingRequiredFields: number;
  estimatedRows: number;
  actionType: "INSERT" | "UPDATE" | "DELETE";
}

export interface ValidationError {
  field: string;
  message: string;
  severity: "error" | "warning" | "info";
}

export interface DataConnectionState {
  // 기본 설정
  connectionType: "data_save" | "external_call";
  currentStep: 1 | 2 | 3;

  // 연결 정보
  fromConnection?: Connection;
  toConnection?: Connection;
  fromTable?: TableInfo;
  toTable?: TableInfo;

  // 매핑 정보
  fieldMappings: FieldMapping[];
  mappingStats: MappingStats;

  // UI 상태
  selectedMapping?: string;
  isLoading: boolean;
  validationErrors: ValidationError[];
}