Files
plantillas-proyectos/backend/api/v1/modules/a76/customs_brokers/dto.py
acazares ba40123333 feat: Enhance Pedimentos CRUD operations with related data handling
- Updated PedimentosService to create and update related tables for Pedimentos.
- Added company_id filtering in queries for Pedimentos.
- Improved error handling and logging during creation and update processes.
- Refactored router tags for consistency and clarity.
- Adjusted API endpoints for customs brokers to include company_id in requests.
- Enhanced company selection logic in various components to prioritize active company.
- Implemented event listeners for company changes to reload data dynamically.
- Updated frontend components to handle loading states and errors more effectively.
- Ensured all relevant routes and API calls are aligned with the new company context.
2025-11-14 18:14:33 -06:00

112 lines
3.0 KiB
Python

from typing import Optional
from pydantic import BaseModel
class CustomsBrokerBaseDTO(BaseModel):
"""Base fields for CustomsBroker"""
type: Optional[str] = None
name: Optional[str] = None
address: Optional[str] = None
postal_code: Optional[str] = None
city: Optional[str] = None
state: Optional[str] = None
phone: Optional[str] = None
fax: Optional[str] = None
email: Optional[str] = None
country: Optional[str] = None
tax_id: Optional[str] = None
personal_id: Optional[str] = None
position: Optional[str] = None
license: Optional[str] = None
company: Optional[str] = None
contact: Optional[str] = None
class CustomsBrokerCreateDTO(CustomsBrokerBaseDTO):
"""Schema for creating a new CustomsBroker"""
broker_key: str
class CustomsBrokerUpdateDTO(CustomsBrokerBaseDTO):
"""Schema for updating an existing CustomsBroker"""
pass
class CustomsBrokerResponseDTO(CustomsBrokerBaseDTO):
"""Schema for CustomsBroker response"""
broker_key: str
tenant_id: int
company_id: int
class Config:
from_attributes = True
# Legacy DTO for backwards compatibility (if needed elsewhere)
class CustomsBrokerDTO(BaseModel):
type: Optional[str] = None
broker_key: str
name: Optional[str] = None
address: Optional[str] = None
postal_code: Optional[str] = None
city: Optional[str] = None
state: Optional[str] = None
phone: Optional[str] = None
fax: Optional[str] = None
email: Optional[str] = None
country: Optional[str] = None
tax_id: Optional[str] = None
personal_id: Optional[str] = None
position: Optional[str] = None
license: Optional[str] = None
company: Optional[str] = None
contact: Optional[str] = None
tenant_id: str
company_id: str
class Config:
from_attributes = True
class CustomsBrokerVUCreateDTO(BaseModel):
certificate_path: Optional[str]
key_path: Optional[str]
access_key: Optional[str]
fiel_format: Optional[str]
signature_read_path: Optional[str]
archive_path: Optional[str]
fiel_access_key: Optional[str]
web_service_user: Optional[str]
web_service_access_key: Optional[str]
vu_email: Optional[str]
vu_figure_type: Optional[str]
xml_files_path: Optional[str]
query_tax_id: Optional[str]
doda_certificate_path: Optional[str]
doda_key_path: Optional[str]
doda_web_service_user: Optional[str]
doda_web_service_access_key: Optional[str]
doda_fiel_access_key: Optional[str]
doda_xml_files_path: Optional[str]
class Config:
from_attributes = True
class CustomsBrokerPersonnelDTO(BaseModel):
broker_key: str
line: int
name: Optional[str]
tax_id: Optional[str]
personal_id: Optional[str]
position: Optional[str]
license: Optional[str]
first_name: Optional[str]
last_name: Optional[str]
middle_name: Optional[str]
email: Optional[str]
class Config:
from_attributes = True