Files
plantillas-proyectos/backend/api/v1/modules/a76/package/dto.py
acazares ef3924a41d Refactor models and services in A76 module
- Updated GBultoService to use models.Package instead of models.GBulto.
- Refactored Part model to use SQLAlchemy 2.0 style with Mapped and mapped_column.
- Added timestamps (created_at, updated_at, deleted_at) to various pedimento models.
- Improved relationships and foreign key constraints in pedimento models.
- Updated PermissionRuleOct and Seal models to use Mapped and mapped_column.
- Changed DTO configuration from orm_mode to from_attributes for better compatibility.
- Removed obsolete models (models.py and models_ped.py) from the repository.
2025-11-07 12:17:26 -06:00

35 lines
786 B
Python

"""
DTOs for GBultos.
"""
from pydantic import BaseModel
from typing import Optional
class GBultoBaseDTO(BaseModel):
CODE: str
DESCRIPTION: Optional[str]
DESCRIPTIONI: Optional[str]
WEIGHT_UNIT: Optional[float]
PLURALS: Optional[str]
PLURAL_IN: Optional[str]
CODE_ACE: Optional[str]
CODE_AAMEX: Optional[str]
class GBultoCreateDTO(GBultoBaseDTO):
pass
class GBultoUpdateDTO(BaseModel):
DESCRIPTION: Optional[str]
DESCRIPTIONI: Optional[str]
WEIGHT_UNIT: Optional[float]
PLURALS: Optional[str]
PLURAL_IN: Optional[str]
CODE_ACE: Optional[str]
CODE_AAMEX: Optional[str]
class GBultoResponseDTO(GBultoBaseDTO):
CREATED_AT: Optional[str]
UPDATED_AT: Optional[str]
class Config:
from_attributes = True