Files
plantillas-proyectos/backend/api/v1/modules/sitar/fracciones/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

39 lines
1.5 KiB
Python

"""Fracciones Schemas"""
from decimal import Decimal
from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
class FraccionesResponse(BaseModel):
"""Fracciones arancelarias mexicanas"""
FRACCION: Optional[str] = Field(None, max_length=10)
FRACCIONPUNTO: Optional[str] = Field(None, max_length=10)
DESCRIPCION: Optional[str] = None
UMCLAVE: Optional[str] = Field(None, max_length=2)
UMABREVIACION: Optional[str] = Field(None, max_length=4)
ADVIMPOTXT: Optional[str] = Field(None, max_length=19)
ADVIMPONUM: Optional[Decimal] = None
TIPOTASAADVIMPO: Optional[int] = None
ADVEXPOTXT: Optional[str] = Field(None, max_length=19)
ADVEXPONUM: Optional[Decimal] = None
TIPOTASAADVEXPO: Optional[int] = None
TASAIVAFRANJA: Optional[Decimal] = None
TASAIVAINTERIOR: Optional[Decimal] = None
TASAISAN: Optional[Decimal] = None
ARANCELMIXTO: Optional[str] = Field(None, max_length=1)
TASAMIXTA: Optional[Decimal] = None
DOF: Optional[str] = Field(None, max_length=8)
NOTAS: Optional[str] = None
HISTORICO: Optional[str] = None
ARANCELESPECIFICO: Optional[str] = Field(None, max_length=1)
TIPOVEHICULO: Optional[str] = Field(None, max_length=1)
APLICAISAN: Optional[str] = Field(None, max_length=1)
APLICAIEPS: Optional[str] = Field(None, max_length=1)
NIVEL: Optional[int] = None
NICO: Optional[str] = Field(None, max_length=14)
SYSID: Optional[int] = None
model_config = ConfigDict(from_attributes=True)