- 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
981 B
Python
27 lines
981 B
Python
"""NOMs Schemas"""
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class NomsResponse(BaseModel):
|
|
"""Normas Oficiales Mexicanas"""
|
|
|
|
FRACCION: Optional[str] = Field("", max_length=10)
|
|
IMPORTACION: Optional[str] = Field("", max_length=1)
|
|
EXPORTACION: Optional[str] = Field("", max_length=1)
|
|
PERMISO: Optional[str] = Field("", max_length=19)
|
|
ACUERDO: Optional[str] = Field("", max_length=100)
|
|
CONDICION: Optional[str] = Field("")
|
|
FUNDAMENTO: Optional[str] = Field("")
|
|
DOF: Optional[str] = Field("", max_length=8)
|
|
FORMATONOM: Optional[str] = Field("", max_length=100)
|
|
INSTRUCCIONES: Optional[str] = Field("", max_length=100)
|
|
CRITERIO: Optional[str] = Field("", max_length=254)
|
|
COMPLEMENTO: Optional[str] = Field("", max_length=999)
|
|
NICO: Optional[str] = Field("", max_length=2)
|
|
PAIS: Optional[str] = Field("", max_length=3)
|
|
SYSID: int
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|