from api.v1.common.tenant_crud_routes import TenantCRUDRoutes

from .dto import VehicleCreateDTO, VehicleResponseDTO, VehicleUpdateDTO
from .services import VehicleService

# Create router using TenantCRUDRoutes factory
# Note: vehicle_key is a string (not int) and is used as the primary key
router = TenantCRUDRoutes(
    service=VehicleService,
    create_schema=VehicleCreateDTO,
    update_schema=VehicleUpdateDTO,
    response_schema=VehicleResponseDTO,
    prefix="/vehicles",
    tags=[],
    resource_name="Vehicle",
    id_name="vehicle_key",  # Using vehicle_key instead of numeric ID
    id_type=str,  # Specify that the ID is a string
    enable_list=True,  # Enable GET /vehicles with pagination
    enable_filters=True,  # Enable filtering by plate_number and transport_type
    default_page_size=50,
    max_page_size=100,
).router
