// Mock data para Telemetria e Rastreamento
// Simula dados de veículos com posições em tempo real

export const mockVehicles = [
  {
    id: 'v1',
    plate: 'ABC-1234',
    driver: 'João Silva',
    client: 'PRALOG',
    lat: -22.9068,
    lng: -43.1729,
    speed: 65,
    timestamp: new Date().toISOString(),
    status: 'ATIVO',
    provider: 'T4S',
    riskStatus: 'NORMAL',
    ignition: true,
    alert: null,
    address: 'Av. Rio Branco, Centro - Rio de Janeiro, RJ'
  },
  {
    id: 'v2',
    plate: 'XYZ-9876',
    driver: 'Maria Santos',
    client: 'PROFARMA',
    lat: -23.5505,
    lng: -46.6333,
    speed: 95, // Acima do limite
    timestamp: new Date().toISOString(),
    status: 'ATIVO',
    provider: 'T4S',
    riskStatus: 'HIGH',
    alert: 'EXCESS_SPEED',
    ignition: true,
    address: 'Av. Paulista, Bela Vista - São Paulo, SP'
  },
  {
    id: 'v3',
    plate: 'DEF-5678',
    driver: 'Carlos Oliveira',
    client: 'PETY',
    lat: -20.5, // Fora da rota (lat > -21.0)
    lng: -43.9345,
    speed: 70,
    timestamp: new Date().toISOString(),
    status: 'ATIVO',
    provider: 'Sascar',
    riskStatus: 'CRITICAL',
    alert: 'FORA_DA_ROTA',
    ignition: true,
    address: 'BR-040, Km 512 - Minas Gerais'
  },
  {
    id: 'v4',
    plate: 'GHI-3456',
    driver: 'Ana Costa',
    client: 'MERCADO_LIVRE',
    lat: -19.9167,
    lng: -43.9345,
    speed: 80,
    timestamp: new Date().toISOString(),
    status: 'ATIVO',
    provider: 'T4S',
    riskStatus: 'NORMAL',
    ignition: true,
    alert: null,
    address: 'Av. Afonso Pena, Centro - Belo Horizonte, MG'
  },
  {
    id: 'v5',
    plate: 'JKL-7890',
    driver: 'Roberto Lima',
    client: 'PRALOG',
    lat: -22.9519,
    lng: -43.2105,
    speed: 0, // Parado
    timestamp: new Date(Date.now() - 360000).toISOString(), // 6 minutos atrás
    status: 'ATIVO',
    provider: 'T4S',
    riskStatus: 'NORMAL',
    alert: 'SIGNAL_LOST',
    ignition: false,
    address: 'Complexo da Maré - Rio de Janeiro, RJ'
  }
];

// Histórico de posições (últimas 50 por veículo)
export const mockPositionHistory = {
  'ABC-1234': [
    { lat: -22.9068, lng: -43.1729, timestamp: new Date(Date.now() - 300000).toISOString(), speed: 60 },
    { lat: -22.9100, lng: -43.1750, timestamp: new Date(Date.now() - 240000).toISOString(), speed: 65 },
    { lat: -22.9150, lng: -43.1800, timestamp: new Date(Date.now() - 180000).toISOString(), speed: 70 },
    { lat: -22.9200, lng: -43.1850, timestamp: new Date(Date.now() - 120000).toISOString(), speed: 65 },
    { lat: -22.9250, lng: -43.1900, timestamp: new Date(Date.now() - 60000).toISOString(), speed: 65 }
  ],
  'XYZ-9876': [
    { lat: -23.5505, lng: -46.6333, timestamp: new Date(Date.now() - 300000).toISOString(), speed: 80 },
    { lat: -23.5550, lng: -46.6380, timestamp: new Date(Date.now() - 240000).toISOString(), speed: 85 },
    { lat: -23.5600, lng: -46.6430, timestamp: new Date(Date.now() - 180000).toISOString(), speed: 90 },
    { lat: -23.5650, lng: -46.6480, timestamp: new Date(Date.now() - 120000).toISOString(), speed: 95 }
  ]
};

// Alertas ativos
export const mockAlerts = mockVehicles.filter(v => v.alert);
