/** Service for shuttle-related API calls (Intercity/Tourism) */
import { apiClient } from './apiClient'
import type { Shuttle } from '@/types'

export interface ShuttleFilters {
    origin?: string
    destination?: string
    company_name?: string
    trip_type?: string
    is_active?: boolean
}

export const shuttlesService = {
    /** Get all shuttles with optional filters */
    async getAllShuttles(filters?: ShuttleFilters): Promise<Shuttle[]> {
        const response = await apiClient.get<Shuttle[]>('/api/shuttles', {
            params: filters,
        })
        return response.data
    },

    /** Get a single shuttle by ID */
    async getShuttleById(id: string): Promise<Shuttle> {
        const response = await apiClient.get<Shuttle>(`/api/shuttles/${id}`)
        return response.data
    },
}
