import { DriverInfo } from "../types";

/**
 * 기사 관리 목업 데이터
 * 실제 환경에서는 REST API로 대체됨
 */
export const MOCK_DRIVERS: DriverInfo[] = [
  {
    id: "DRV001",
    name: "홍길동",
    vehicleNumber: "12가 3456",
    vehicleType: "1톤 트럭",
    phone: "010-1234-5678",
    status: "driving",
    departure: "서울시 강남구",
    destination: "경기도 성남시",
    departureTime: "2025-10-14T09:00:00",
    estimatedArrival: "2025-10-14T11:30:00",
    progress: 65,
  },
  {
    id: "DRV002",
    name: "김철수",
    vehicleNumber: "34나 7890",
    vehicleType: "2.5톤 트럭",
    phone: "010-2345-6789",
    status: "standby",
  },
  {
    id: "DRV003",
    name: "이영희",
    vehicleNumber: "56다 1234",
    vehicleType: "5톤 트럭",
    phone: "010-3456-7890",
    status: "driving",
    departure: "인천광역시",
    destination: "충청남도 천안시",
    departureTime: "2025-10-14T08:30:00",
    estimatedArrival: "2025-10-14T10:00:00",
    progress: 85,
  },
  {
    id: "DRV004",
    name: "박민수",
    vehicleNumber: "78라 5678",
    vehicleType: "카고",
    phone: "010-4567-8901",
    status: "resting",
  },
  {
    id: "DRV005",
    name: "정수진",
    vehicleNumber: "90마 9012",
    vehicleType: "냉동차",
    phone: "010-5678-9012",
    status: "maintenance",
  },
  {
    id: "DRV006",
    name: "최동욱",
    vehicleNumber: "11아 3344",
    vehicleType: "1톤 트럭",
    phone: "010-6789-0123",
    status: "driving",
    departure: "부산광역시",
    destination: "울산광역시",
    departureTime: "2025-10-14T07:45:00",
    estimatedArrival: "2025-10-14T09:15:00",
    progress: 92,
  },
  {
    id: "DRV007",
    name: "강미선",
    vehicleNumber: "22자 5566",
    vehicleType: "탑차",
    phone: "010-7890-1234",
    status: "standby",
  },
  {
    id: "DRV008",
    name: "윤성호",
    vehicleNumber: "33차 7788",
    vehicleType: "2.5톤 트럭",
    phone: "010-8901-2345",
    status: "driving",
    departure: "대전광역시",
    destination: "세종특별자치시",
    departureTime: "2025-10-14T10:20:00",
    estimatedArrival: "2025-10-14T11:00:00",
    progress: 45,
  },
  {
    id: "DRV009",
    name: "장혜진",
    vehicleNumber: "44카 9900",
    vehicleType: "냉동차",
    phone: "010-9012-3456",
    status: "resting",
  },
  {
    id: "DRV010",
    name: "임태양",
    vehicleNumber: "55타 1122",
    vehicleType: "5톤 트럭",
    phone: "010-0123-4567",
    status: "driving",
    departure: "광주광역시",
    destination: "전라남도 목포시",
    departureTime: "2025-10-14T06:30:00",
    estimatedArrival: "2025-10-14T08:45:00",
    progress: 78,
  },
  {
    id: "DRV011",
    name: "오준석",
    vehicleNumber: "66파 3344",
    vehicleType: "카고",
    phone: "010-1111-2222",
    status: "standby",
  },
  {
    id: "DRV012",
    name: "한소희",
    vehicleNumber: "77하 5566",
    vehicleType: "1톤 트럭",
    phone: "010-2222-3333",
    status: "maintenance",
  },
  {
    id: "DRV013",
    name: "송민재",
    vehicleNumber: "88거 7788",
    vehicleType: "탑차",
    phone: "010-3333-4444",
    status: "driving",
    departure: "경기도 수원시",
    destination: "경기도 평택시",
    departureTime: "2025-10-14T09:50:00",
    estimatedArrival: "2025-10-14T11:20:00",
    progress: 38,
  },
  {
    id: "DRV014",
    name: "배수지",
    vehicleNumber: "99너 9900",
    vehicleType: "2.5톤 트럭",
    phone: "010-4444-5555",
    status: "driving",
    departure: "강원도 춘천시",
    destination: "강원도 원주시",
    departureTime: "2025-10-14T08:00:00",
    estimatedArrival: "2025-10-14T09:30:00",
    progress: 72,
  },
  {
    id: "DRV015",
    name: "신동엽",
    vehicleNumber: "00더 1122",
    vehicleType: "5톤 트럭",
    phone: "010-5555-6666",
    status: "standby",
  },
];

/**
 * 차량 유형 목록
 */
export const VEHICLE_TYPES = ["1톤 트럭", "2.5톤 트럭", "5톤 트럭", "카고", "탑차", "냉동차"];

/**
 * 운행 상태별 통계 계산
 */
export function getDriverStatistics(drivers: DriverInfo[]) {
  return {
    total: drivers.length,
    driving: drivers.filter((d) => d.status === "driving").length,
    standby: drivers.filter((d) => d.status === "standby").length,
    resting: drivers.filter((d) => d.status === "resting").length,
    maintenance: drivers.filter((d) => d.status === "maintenance").length,
  };
}
