- Updated multiple DTO classes across various modules to replace the `Config` class with `model_config = ConfigDict(from_attributes=True)`. - This change enhances consistency in attribute handling and aligns with the latest Pydantic practices. - Adjusted error handling in core modules to change status codes from `HTTP_422_UNPROCESSABLE_ENTITY` to `HTTP_422_UNPROCESSABLE_CONTENT` for improved clarity in validation responses.
27 lines
967 B
Python
27 lines
967 B
Python
"""Fundamentos TLC Schemas"""
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class FundamentosTLCResponse(BaseModel):
|
|
"""Fundamentos de tratados de libre comercio"""
|
|
|
|
FRACCION: Optional[str] = Field(None, max_length=8)
|
|
PAIS: Optional[str] = Field(None, max_length=3)
|
|
ACUERDO: Optional[str] = Field(None, max_length=5)
|
|
TASA1TXT: Optional[str] = Field(None, max_length=19)
|
|
TASA1NUM: Optional[str] = None
|
|
TASA2TXT: Optional[str] = Field(None, max_length=19)
|
|
TASA2NUM: Optional[str] = None
|
|
FUNDAMENTO1: Optional[str] = None
|
|
FUNDAMENTO2: Optional[str] = None
|
|
PERIODO: Optional[str] = Field(None, max_length=299)
|
|
MODALIDAD: Optional[str] = Field(None, max_length=999)
|
|
DOF: Optional[str] = Field(None, max_length=8)
|
|
NOTAS: Optional[str] = Field(None, max_length=20)
|
|
NICO: Optional[str] = Field("", max_length=2)
|
|
SYSID: int
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|