/**
 * TypeScript types for carbon equivalency comparisons
 */

/**
 * Categories for grouping carbon equivalency comparisons
 */
export enum ComparisonCategory {
  TRANSPORTATION = 'transportation',
  AVIATION = 'aviation',
  NATURAL = 'natural',
  ENERGY = 'energy',
  YACHT_SPECIFIC = 'yacht_specific',
  LIFESTYLE = 'lifestyle',
}

/**
 * A single carbon equivalency comparison
 */
export interface CarbonComparison {
  /** Category this comparison belongs to */
  category: ComparisonCategory;

  /** Lucide icon name (e.g., 'Car', 'Plane', 'TreePine') */
  icon: string;

  /** Calculated numeric value for this comparison */
  value: number;

  /** Unit label (e.g., 'miles', 'trees', 'kWh') */
  unit: string;

  /** Full label for the comparison (e.g., 'Miles driven in an average car') */
  label: string;

  /** Optional detailed description */
  description?: string;

  /** Source citation (e.g., 'EPA 2024', 'DEFRA 2024', 'IMO 2024') */
  source: string;

  /** Priority level for display ordering (1-5, higher = more relevant) */
  priority?: number;
}

/**
 * Configuration for comparison selection
 */
export interface ComparisonSelectionConfig {
  /** Number of comparisons to show */
  count: number;

  /** Categories to prioritize */
  preferredCategories?: ComparisonCategory[];

  /** Minimum tons CO2 threshold for this configuration */
  minTons: number;

  /** Maximum tons CO2 threshold for this configuration */
  maxTons: number;
}

/**
 * Range-based comparison selection rules
 */
export interface ComparisonRange {
  /** Minimum tons CO2 for this range */
  minTons: number;

  /** Maximum tons CO2 for this range (undefined = infinity) */
  maxTons?: number;

  /** Comparison keys to use for this range */
  comparisonKeys: string[];

  /** Description of this range */
  rangeDescription: string;
}
