- Updated SealService to support tenant and company filtering with pagination and enhanced CRUD methods. - Refactored TrailerService to include tenant and company support, added filtering capabilities, and improved CRUD methods. - Introduced TenantCRUDRoutes for Trailer and Transporter routes to streamline API endpoint creation and management. - Enhanced TransporterService with tenant and company filtering, pagination, and improved CRUD operations. - Added Customs Broker module with DTOs, models, services, and routes for managing customs broker data. - Implemented CRUD operations for Customs Broker, including personnel and VU management. - Improved data validation and descriptions in DTOs for better API documentation.
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
|