import { Integration } from './../integration/interfaces/integration.interface';
/**
 * Representa a estrutura de dados de um veículo no sistema.
 * Baseado na estrutura real da API.
 */
export interface Vehicle {
    id: number;
    selected?: boolean;
    license_plate: string;
    number_renavan?: string;
    vin?: string; // chassis
    number_crv?: string;
    doc_year?: number;
    model: string;
    model_year?: number;
    version?: string;
    manufacture_year?: number;
    brand: string;
    mark?: string;
    group?: string;
    color?: {
        name: string;
        code: string;
    };
    type: VehicleType;
    body_type?: string;
    number_seats?: number;
    number_doors?: number;
    number_large_bags?: number;
    number_small_bags?: number;
    engine_number?: string;
    engine_power?: number;
    cylinders_number?: number;
    axles_number?: number;
    volume_engine?: number;
    volume_tank?: number;
    fuel?: string;
    transmission?: string;
    options?: Array<{
        id: string | number;
        name: string;
        value: boolean;
    }>;
    price?: number;
    status: string;
    description?: string;
    
    // Localização e endereço
    last_latitude?: number | null;
    last_longitude?: number | null;
    last_address_cep?: string;
    last_address_city?: string;
    last_address_uf?: string;
    last_address_street?: string;
    last_address_number?: string;
    last_address_complement?: string;
    last_address_neighborhood?: string;
    last_location_timestamp?: string;
    last_odometer?: number;
    
    // Registro
    registered_at?: string;
    registered_at_city?: string;
    registered_at_uf?: string;
    
    // Relacionamentos
    owner_person_id?: number;
    owner_person_name?: string;
    company_id?: number;
    driver_id?: number;
    alienation_person_id?: number;
    alienation_person_name?: string;
    alienation_price?: number;
    alienation_payment_method?: string;
    alienation_payment_installment?: number;
    alienation_payment_installment_value?: number;
    alienation_payment_installment_total?: number;
    alienation_payment_installment_payment?: number;
    location_person_id?: number;
    location_person_name?: string;
    
    // Documentos e fotos
    license_documents?: any[];
    salesPhotoIds?: number[];
    
    // Metadados
    createdAt?: string;
    updatedAt?: string;
    
    // Campos extras para manutenção (não vindos da API)
    insurance_policy?: string;
    insurance_due_date?: string;
    license_due_date?: string;
    last_maintenance?: string;
    next_maintenance?: string;
    monthly_cost?: number;
    company_name?: string;
    driver_name?: string;
    vehicleStatus?: VehicleStatus;
    
    consumption?: number;
    last_speed?: number;
    last_fuel_level?: number;
    last_engine_hours?: number;
    min_price?: number;
    price_sale?: number;
    fleetType?: VehicleFleetType;

}
export interface VehicleFleetType {
    RENTAL: string;
    CORPORATE: string;
    AGGREGATE: string;
    FIXED_RENTAL: string;
    FIXED_DAILY: string;
    OTHER: string;
  }

export interface VehicleStatus {
    Available: string;
    InUse: string;
    Maintenance: string;
    OutOfService: string;
    Broken: string;
    Sold: string;
    Stolen: string;
    Accident: string;
    Reserved: string;
    Inactive: string;
} 

export interface VehicleIntegration {
    integrationId: number;
    vehicleId: number;
}

export type VehicleType =
  | "TRAILER"
  | "CAR"
  | "TRUCK"
  | "MOTORCYCLE"
  | "VAN"
  | "BUS"
  | "PICKUP_TRUCK"
  | "SEMI_TRUCK"
  | "TRUCK_TRAILER"
  | "UTILITY"
  | "UNIDENTIFIED"
  | "OTHER"
  | "MINIBUS"
  | "MOTOR_SCOOTER"
  | "MOPED"
  | "TRICYCLE";
  