from fastapi import APIRouter
from api.v1.common.tenant_crud_routes import TenantCRUDRoutes
from .dto import TransporterCreateDTO, TransporterResponseDTO, TransporterUpdateDTO
from .services import TransporterService
from api.v1.modules.a76.layouts_csv.transportistas.routes import router as imports_router

router = APIRouter()
router.include_router(imports_router, prefix="/transporters/imports", tags=["a76 / transporters / csv_import"])

crud_router = TenantCRUDRoutes(
    service=TransporterService,
    create_schema=TransporterCreateDTO,
    update_schema=TransporterUpdateDTO,
    response_schema=TransporterResponseDTO,
    prefix="/transporters",
    tags=[],
    resource_name="Transporter",
    id_name="transporter_key",  
    id_type=str,  
    enable_list=True,  
    enable_filters=True,  
    default_page_size=50,
    max_page_size=100,
    list_permissions=["transporters.view"],
    get_permissions=["transporters.view"],
    create_permissions=["transporters.create"],
    update_permissions=["transporters.edit"],
    delete_permissions=["transporters.delete"],
).router

router.include_router(crud_router)