/**
 * @ai-summary Types for enhanced fuel logs UI
 */

export type UnitSystem = 'imperial' | 'metric';

export enum FuelType {
  GASOLINE = 'gasoline',
  DIESEL = 'diesel',
  ELECTRIC = 'electric'
}

export type FuelGrade = '87' | '88' | '89' | '91' | '93' | '#1' | '#2' | null;

export interface LocationData {
  address?: string;
  coordinates?: { latitude: number; longitude: number };
  googlePlaceId?: string;
  stationName?: string;
}

export type DistanceType = 'odometer' | 'trip';

export interface CreateFuelLogRequest {
  vehicleId: string;
  dateTime: string;
  odometerReading?: number;
  tripDistance?: number;
  fuelType: FuelType;
  fuelGrade?: FuelGrade;
  fuelUnits: number;
  costPerUnit: number;
  locationData?: LocationData;
  notes?: string;
}

export interface UpdateFuelLogRequest {
  dateTime?: string;
  odometerReading?: number;
  tripDistance?: number;
  fuelType?: FuelType;
  fuelGrade?: FuelGrade;
  fuelUnits?: number;
  costPerUnit?: number;
  locationData?: LocationData;
  notes?: string;
}

export interface FuelLogResponse {
  id: string;
  userId: string;
  vehicleId: string;
  dateTime: string;
  odometerReading?: number;
  tripDistance?: number;
  fuelType: FuelType;
  fuelGrade?: FuelGrade;
  fuelUnits: number;
  costPerUnit: number;
  totalCost: number;
  locationData?: LocationData;
  efficiency?: number;
  efficiencyLabel: string;
  notes?: string;
  createdAt: string;
  updatedAt: string;
}

export interface EnhancedFuelStats {
  logCount: number;
  totalFuelUnits: number;
  totalCost: number;
  averageCostPerUnit: number;
  totalDistance: number;
  averageEfficiency: number;
  unitLabels: { fuelUnits: string; distanceUnits: string; efficiencyUnits: string };
}

export interface FuelGradeOption {
  value: FuelGrade;
  label: string;
  description?: string;
}

