export interface SheetInfo {
  id: string;
  name: string;
  isExternal?: boolean; // True if loaded from an external file
  fileName?: string;    // The name of the external file
  externalData?: any[][]; // The raw parsed data from SheetJS
}

export interface ColumnMappingInfo {
  targetColumn: string;
  sourceColumnIndex: number; // -1 if not found
}

export interface SheetMappingStatus {
  sheetName: string;
  headerRowIndex: number; // 0-indexed
  mappings: ColumnMappingInfo[];
  availableColumns: { name: string; index: number }[];
  isExternal?: boolean;
  externalData?: any[][];
}

export interface TargetColumnDef {
  id: string; // e.g. "K-Nr."
  aliases: string[]; // e.g. ["k-nr.", "kabelnummer", "nr."]
}

export const TARGET_COLUMNS: TargetColumnDef[] = [
  { id: "K-Nr.", aliases: ["k-nr.", "k-nr", "kabelnummer", "kabel", "nummer", "nr.", "nr"] },
  { id: "Bezeichnung", aliases: ["bezeichnung", "name", "titel", "beschreibung"] },
  { id: "von", aliases: ["von", "start", "quelle", "ursprung"] },
  { id: "von Raum", aliases: ["von raum", "raum von", "raum (von)", "startraum"] },
  { id: "nach", aliases: ["nach", "ziel", "ende", "destination"] },
  { id: "nach Raum", aliases: ["nach raum", "raum nach", "raum (nach)", "zielraum"] },
  { id: "Kabeltyp", aliases: ["kabeltyp", "typ", "kabelart", "art", "querschnitt"] }
];
