- 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.
35 lines
935 B
Python
35 lines
935 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class TrailerBaseDTO(BaseModel):
|
|
trailer_number: str = Field(..., description="Trailer number (primary identifier)")
|
|
ace_trailer_number: Optional[str] = None
|
|
trailer_type_key: Optional[str] = None
|
|
seal: Optional[str] = None
|
|
entity_code: Optional[str] = None
|
|
plate_number: Optional[str] = None
|
|
state: Optional[str] = None
|
|
country: Optional[str] = None
|
|
container_key: Optional[str] = None
|
|
|
|
|
|
class TrailerCreateDTO(TrailerBaseDTO):
|
|
"""Schema for creating a trailer"""
|
|
pass
|
|
|
|
|
|
class TrailerUpdateDTO(TrailerBaseDTO):
|
|
"""Schema for updating a trailer"""
|
|
trailer_number: Optional[str] = Field(None, description="Trailer number (cannot be modified)")
|
|
|
|
|
|
class TrailerResponseDTO(TrailerBaseDTO):
|
|
"""Schema for trailer response"""
|
|
company_id: int
|
|
tenant_id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|