// Structured result från receipt item matching
export interface MatchDecision {
  // Produkt-matchning
  matchedProductId?: number;
  suggestedProductId?: number;
  matchedProductName?: string;
  suggestedProductName?: string;
  matchedVia: 'alias' | 'wordmatch' | 'none';

  // Kategori
  category?: {
    id: number;
    name: string;
    path: string;
    confidence: 'high' | 'medium' | 'low';
    source: 'alias' | 'product' | 'rule' | 'ai' | 'guard';
    usedFallback: boolean;
  };

  // Enhet
  unit?: string;

  // Debug
  debug?: {
    rawName: string;
    signal: string;
    steps: string[];
    decisionTree: {
      alias?: { found: boolean; productId?: number };
      wordMatch?: { found: boolean; productId?: number; score?: number };
      rule?: { found: boolean; path?: string };
      ai?: { called: boolean; result?: string };
      guard?: { applied: boolean; oldPath?: string; newPath?: string };
    };
  };
}
