- 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.
25 lines
879 B
Python
25 lines
879 B
Python
"""REIT Schemas"""
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class ReitResponse(BaseModel):
|
|
"""Registro de Empresas de Industria Terminal"""
|
|
|
|
FRACCION: Optional[str] = Field(None, max_length=10)
|
|
ARTICULO: Optional[str] = Field(None, max_length=50)
|
|
FUNDAMENTO: Optional[str] = Field(None, max_length=1500)
|
|
ACUERDO: Optional[str] = Field(None, max_length=500)
|
|
PERMISO: Optional[str] = Field(None, max_length=2)
|
|
DOF: Optional[str] = Field(None, max_length=8)
|
|
DOCUMENTO: Optional[str] = Field(None, max_length=200)
|
|
TEMPORALIDAD: Optional[int] = None
|
|
TEMPORALIDADSERVICIO: Optional[int] = None
|
|
TEMPORALIDADCERTIFICADA: Optional[int] = None
|
|
WEB_DOCUMENTO_ID: Optional[int] = None
|
|
NICO: Optional[str] = Field("", max_length=2)
|
|
SYSID: int
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|