- 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.
26 lines
834 B
Python
26 lines
834 B
Python
"""RCG2 Schemas"""
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class Rcg2Response(BaseModel):
|
|
"""Reglas de Carácter General"""
|
|
|
|
FRACCION: Optional[str] = Field(None, max_length=10)
|
|
ANEXO: Optional[str] = Field(None, max_length=19)
|
|
SECTOR: Optional[str] = None
|
|
REGIMEN: Optional[str] = None
|
|
CONDICION: Optional[str] = None
|
|
ADUANAS: Optional[str] = Field(None, max_length=1000)
|
|
DOF: Optional[str] = Field(None, max_length=8)
|
|
ARCHIVOCRITERIO: Optional[str] = Field(None, max_length=1000)
|
|
TIPO: Optional[str] = Field(None, max_length=1)
|
|
IMPO: Optional[int] = None
|
|
EXPO: Optional[int] = None
|
|
WEB_DOCUMENTO_ID: Optional[int] = None
|
|
NICO: Optional[str] = Field("", max_length=2)
|
|
SYSID: int
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|