// Mock data para Checklist e Manutenção
// Simula veículos com status de checklist e ordens de serviço

export const mockVehicles = [
  {
    id: 'v1',
    plate: 'ABC-1234',
    type: 'CAVALO',
    driver: 'João Silva',
    client: 'PRALOG',
    checklistExpiry: '2026-03-01', // Válido
    insuranceExpiry: '2026-04-15',
    anttExpiry: '2026-05-20',
    status: 'VALID',
    lastRenewal: '2026-02-01T10:00:00Z',
    tractorId: null,
    trailerId: 'trailer-001'
  },
  {
    id: 'v2',
    plate: 'XYZ-9876',
    type: 'TRUCK',
    driver: 'Maria Souza',
    client: 'PROFARMA',
    checklistExpiry: '2026-02-10', // Warning (< 7 dias)
    insuranceExpiry: '2026-02-08',
    anttExpiry: '2026-02-12',
    status: 'WARNING',
    lastRenewal: '2026-01-10T14:30:00Z',
    tractorId: null,
    trailerId: null
  },
  {
    id: 'v3',
    plate: 'DEF-5678',
    type: 'CAVALO',
    driver: 'Carlos Lima',
    client: 'PETY',
    checklistExpiry: '2026-01-30', // Expirado
    insuranceExpiry: '2026-01-25',
    anttExpiry: '2026-01-28',
    status: 'EXPIRED',
    lastRenewal: '2025-12-30T09:00:00Z',
    tractorId: null,
    trailerId: 'trailer-002'
  },
  {
    id: 'v4',
    plate: 'GHI-3456',
    type: 'CARRETA',
    driver: null,
    client: 'MERCADO_LIVRE',
    checklistExpiry: '2026-03-15',
    insuranceExpiry: '2026-04-20',
    anttExpiry: '2026-05-10',
    status: 'VALID',
    lastRenewal: '2026-02-15T11:00:00Z',
    tractorId: 'v1',
    trailerId: null
  },
  {
    id: 'v5',
    plate: 'JKL-7890',
    type: 'CAVALO',
    driver: 'Roberto Lima',
    client: 'PRALOG',
    checklistExpiry: '2026-02-08', // Warning
    insuranceExpiry: '2026-03-01',
    anttExpiry: '2026-02-15',
    status: 'WARNING',
    lastRenewal: '2026-01-08T16:00:00Z',
    tractorId: null,
    trailerId: null
  }
];

// Ordens de Serviço (OS)
export const mockMaintenanceLogs = [
  {
    id: 'os-001',
    vehicleId: 'v2',
    plate: 'XYZ-9876',
    type: 'SENSOR',
    osNumber: 'OS-2024-001',
    sensor: 'Baú',
    description: 'Falha no sensor de temperatura do baú',
    status: 'ABERTO',
    createdAt: '2026-02-01T10:00:00Z',
    createdBy: 'Supervisor João',
    resolvedAt: null,
    resolvedBy: null
  },
  {
    id: 'os-002',
    vehicleId: 'v1',
    plate: 'ABC-1234',
    type: 'INTERNO',
    osNumber: 'OS-2024-002',
    sensor: null,
    description: 'Manutenção preventiva - troca de óleo',
    status: 'RESOLVIDO',
    createdAt: '2026-01-28T14:30:00Z',
    createdBy: 'Supervisor Maria',
    resolvedAt: '2026-01-29T16:45:00Z',
    resolvedBy: 'Mecânico Pedro'
  },
  {
    id: 'os-003',
    vehicleId: 'v3',
    plate: 'DEF-5678',
    type: 'SENSOR',
    osNumber: 'OS-2024-003',
    sensor: 'Pneu',
    description: 'Sensor de pressão dos pneus com defeito',
    status: 'ABERTO',
    createdAt: '2026-02-03T09:15:00Z',
    createdBy: 'Supervisor João',
    resolvedAt: null,
    resolvedBy: null
  },
  {
    id: 'os-004',
    vehicleId: 'v5',
    plate: 'JKL-7890',
    type: 'INTERNO',
    osNumber: 'OS-2024-004',
    sensor: null,
    description: 'Revisão geral de 10.000 km',
    status: 'RESOLVIDO',
    createdAt: '2026-01-25T11:00:00Z',
    createdBy: 'Supervisor Maria',
    resolvedAt: '2026-01-26T15:30:00Z',
    resolvedBy: 'Mecânico Carlos'
  }
];

// Conjuntos (Sets) - Cavalo + Carreta
export const mockSets = [
  {
    id: 'set-001',
    name: 'Conjunto 1',
    tractorId: 'v1',
    tractorPlate: 'ABC-1234',
    trailerId: 'v4',
    trailerPlate: 'GHI-3456',
    driver: 'João Silva',
    client: 'PRALOG',
    status: 'ATIVO'
  }
];

// Estatísticas
export const mockChecklistStats = {
  valid: mockVehicles.filter(v => v.status === 'VALID').length,
  warning: mockVehicles.filter(v => v.status === 'WARNING').length,
  expired: mockVehicles.filter(v => v.status === 'EXPIRED').length,
  openOS: mockMaintenanceLogs.filter(os => os.status === 'ABERTO').length,
  resolvedOS: mockMaintenanceLogs.filter(os => os.status === 'RESOLVIDO').length
};
