import { RouteEntity } from '@d8d/server/modules/routes/route.entity';
import { ActivityEntity } from '@d8d/server/modules/activities/activity.entity';
import { LocationResponse } from './location.types';
import { VehicleType, TravelMode } from '@d8d/server/modules/routes/route.schema';

// 路线类型定义
export type Route = RouteEntity;

// 路线创建请求
export interface CreateRouteRequest {
  name: string;
  description?: string | null;
  startLocationId: number;
  endLocationId: number;
  pickupPoint: string;
  dropoffPoint: string;
  departureTime: Date;
  vehicleType: string;
  travelMode: string;
  price: number;
  seatCount: number;
  availableSeats: number;
  activityId: number;
}

// 路线更新请求
export interface UpdateRouteRequest {
  name?: string;
  description?: string | null;
  startLocationId?: number;
  endLocationId?: number;
  pickupPoint?: string;
  dropoffPoint?: string;
  departureTime?: Date;
  vehicleType?: string;
  travelMode?: string;
  price?: number;
  seatCount?: number;
  availableSeats?: number;
  activityId?: number;
  isDisabled?: number;
}

// 路线响应
export interface RouteResponse {
  id: number;
  name: string;
  description: string | null;
  startLocationId: number;
  endLocationId: number;
  startLocation: LocationResponse;
  endLocation: LocationResponse;
  pickupPoint: string;
  dropoffPoint: string;
  departureTime: Date;
  vehicleType: string;
  travelMode: string;
  price: number;
  seatCount: number;
  availableSeats: number;
  activityId: number;
  activity?: ActivityEntity;
  routeType: 'departure' | 'return';
  isDisabled: number;
  isDeleted: number;
  createdAt: Date;
  updatedAt: Date;
}

// 路线列表响应
export interface RouteListResponse {
  items: RouteResponse[];
  total: number;
  page: number;
  pageSize: number;
}

// 路线搜索参数
export interface RouteSearchParams {
  keyword?: string;
  vehicleType?: string;
  travelMode?: string;
  routeType?: 'departure' | 'return';
  minPrice?: number;
  maxPrice?: number;
  activityId?: number;
  isDisabled?: number;
  page?: number;
  pageSize?: number;
  sortBy?: string;
  sortOrder?: 'ASC' | 'DESC';
}