- Added a data table for displaying customs brokers with columns for key, name, type, license, RFC, email, phone, city, and actions. - Created a dialog for adding new customs brokers with a form for inputting necessary details. - Implemented actions for viewing details and deleting customs brokers with confirmation dialogs. - Integrated search functionality to find customs brokers by their key. - Established server-side loading for the customs brokers page to handle authentication and data retrieval.
23 lines
848 B
Python
23 lines
848 B
Python
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
|