Files
plantillas-proyectos/backend/api/v1/modules/sitar/cuotas2/schemas.py
AlexeerCT 23509cbcc9 Refactor DTO classes to use model_config with ConfigDict for attribute handling
- 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.
2026-03-24 12:06:55 -05:00

30 lines
1.1 KiB
Python

"""Cuotas2 Schemas"""
from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
class Cuotas2Response(BaseModel):
"""Cuotas compensatorias"""
FRACCION: Optional[str] = Field(None, max_length=10)
PRODUCTO: Optional[str] = Field(None, max_length=300)
PAIS: Optional[str] = Field(None, max_length=3)
DOF: Optional[str] = Field(None, max_length=8)
DOF2: Optional[str] = Field(None, max_length=149)
EMPRESA: Optional[str] = Field(None, max_length=100)
INCOTERM: Optional[str] = Field(None, max_length=10)
DOLARES: Optional[str] = None
CLAVEMONEDA: Optional[str] = Field(None, max_length=3)
CLAVEUM: Optional[str] = Field(None, max_length=2)
PORCENTAJE: Optional[str] = None
DESCRIPCIONDOLARES: Optional[str] = Field(None, max_length=50)
NOTAS: Optional[str] = None
ESTATUS: Optional[str] = Field(None, max_length=19)
NUMERORESOLUCION: Optional[int] = None
RESOLUCION: Optional[str] = Field(None, max_length=150)
NICO: Optional[str] = Field("", max_length=2)
SYSID: int
model_config = ConfigDict(from_attributes=True)