from api.v1.common.tenant_crud_routes import TenantCRUDRoutes

from .dto import TransporterCreateDTO, TransporterResponseDTO, TransporterUpdateDTO
from .services import TransporterService

# Create router using TenantCRUDRoutes factory
# Note: transporter_key is a string (not int) and is used as the primary key
router = TenantCRUDRoutes(
    service=TransporterService,
    create_schema=TransporterCreateDTO,
    update_schema=TransporterUpdateDTO,
    response_schema=TransporterResponseDTO,
    prefix="/transporters",
    tags=[],
    resource_name="Transporter",
    id_name="transporter_key",  # Using transporter_key instead of numeric ID
    id_type=str,  # Specify that the ID is a string
    enable_list=True,  # Enable GET /transporters with pagination
    enable_filters=True,  # Enable filtering by name and rfc
    default_page_size=50,
    max_page_size=100,
).router
