diff --git a/backend/api/v1/modules/sitar/fracciones/schemas.py b/backend/api/v1/modules/sitar/fracciones/schemas.py index 7fbd57e3..c4811a3d 100644 --- a/backend/api/v1/modules/sitar/fracciones/schemas.py +++ b/backend/api/v1/modules/sitar/fracciones/schemas.py @@ -1,5 +1,6 @@ """Fracciones Schemas""" +from decimal import Decimal from typing import Optional from pydantic import BaseModel, Field @@ -8,13 +9,30 @@ 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 - UMT: Optional[str] = Field(None, max_length=2) - UMC: Optional[str] = Field(None, max_length=2) - IMPUESTO_EXP: Optional[str] = Field(None, max_length=19) - IMPUESTO_IMP: Optional[str] = Field(None, max_length=19) - NICO: Optional[str] = Field("", max_length=2) - SYSID: int + 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) class Config: from_attributes = True diff --git a/backend/api/v1/modules/sitar/prosec/router.py b/backend/api/v1/modules/sitar/prosec/router.py index 7bea6cff..22a15267 100644 --- a/backend/api/v1/modules/sitar/prosec/router.py +++ b/backend/api/v1/modules/sitar/prosec/router.py @@ -13,6 +13,8 @@ router = APIRouter() async def search_prosec( fraccion: Optional[str] = Query(None), nico: Optional[str] = Query(None), + sector: Optional[str] = Query(None), + articulo: Optional[str] = Query(None), skip: int = Query(0, ge=0), limit: int = Query(100, ge=1, le=1000), current_user: dict = Depends(get_current_user), @@ -20,7 +22,12 @@ async def search_prosec( try: service = ProsecService.get_instance() return await service.search( - fraccion=fraccion, nico=nico, skip=skip, limit=limit + fraccion=fraccion, + nico=nico, + sector=sector, + articulo=articulo, + skip=skip, + limit=limit, ) except Exception as e: raise HTTPException(status_code=500, detail=f"Error: {str(e)}") diff --git a/backend/api/v1/modules/sitar/prosec/service.py b/backend/api/v1/modules/sitar/prosec/service.py index a489cc2e..f4a9c7bf 100644 --- a/backend/api/v1/modules/sitar/prosec/service.py +++ b/backend/api/v1/modules/sitar/prosec/service.py @@ -20,6 +20,8 @@ class ProsecService(SitarAPIBaseService): self, fraccion: Optional[str] = None, nico: Optional[str] = None, + sector: Optional[str] = None, + articulo: Optional[str] = None, skip: int = 0, limit: int = 100, ) -> List[ProsecResponse]: @@ -28,6 +30,10 @@ class ProsecService(SitarAPIBaseService): params["fraccion"] = fraccion if nico: params["nico"] = nico + if sector: + params["sector"] = sector + if articulo: + params["articulo"] = articulo data = await self._make_request("GET", "/api/v1/prosec/", params=params) return [ProsecResponse(**item) for item in data]