- 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.
32 lines
609 B
Python
32 lines
609 B
Python
"""
|
|
DTOs for Seal.
|
|
"""
|
|
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SealBaseDTO(BaseModel):
|
|
seal: str = Field(..., description="Seal identifier", max_length=15)
|
|
|
|
|
|
class SealCreateDTO(SealBaseDTO):
|
|
"""Schema for creating a seal"""
|
|
pass
|
|
|
|
|
|
class SealUpdateDTO(SealBaseDTO):
|
|
"""Schema for updating a seal"""
|
|
seal: Optional[str] = Field(None, description="Seal identifier", max_length=15)
|
|
|
|
|
|
class SealResponseDTO(SealBaseDTO):
|
|
"""Schema for seal response"""
|
|
id: int
|
|
company_id: int
|
|
tenant_id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|