diff --git a/backend/api/v1/modules/a76/general_catalogs/fractions/tariff_fractions/service.py b/backend/api/v1/modules/a76/general_catalogs/fractions/tariff_fractions/service.py index a98f78eb..80c95b2d 100644 --- a/backend/api/v1/modules/a76/general_catalogs/fractions/tariff_fractions/service.py +++ b/backend/api/v1/modules/a76/general_catalogs/fractions/tariff_fractions/service.py @@ -164,16 +164,13 @@ class TariffFractionService: search_description = term try: - usa_items = await usa_service.search( + usa_items, total = await usa_service.search_with_total( fraccion=search_term, descripcion=search_description, skip=skip, limit=limit, ) items = [TariffFractionMapper.to_domain_usa(item) for item in usa_items] - total = len(items) + skip - if len(items) == limit: - total += 1 return items, total except Exception as e: import traceback @@ -245,30 +242,25 @@ class TariffFractionService: # Note: Sitar search might not return total count. # We fetch page items. Pagination might be tricky if Sitar doesn't return total. # Assuming Sitar returns a list. - sitar_items = await sitar_service.search( + sitar_items, total = await sitar_service.search_with_total( fraccion=sitar_fraccion, nico=sitar_nico, description=sitar_description, nivel=level_filter, # Dynamic level skip=skip, - limit=limit + limit=limit, ) - + # STRICT API USAGE: # We do NOT fallback to local DB on empty list, as user requested strict API consumption. # We also do NOT attempt enrichment as codes mismatch (API uses '010191A' vs Local '01012101'). - + # Map items items = [TariffFractionMapper.to_domain(item) for item in sitar_items] # Legacy browse behavior: keep table in ascending fracción order. items = sorted(items, key=lambda row: ((row.code or ""), (row.nico or ""))) - - # Estimate total (Sitar service doesn't return total currently) - # If we got full limit, assume there are more. - total = len(items) + skip - if len(items) == limit: - total += 1 # Indicate more pages - + + # total comes from SITAR PaginatedFraccionesResponse (matches API-wide count for the query). return items, total except Exception as e: diff --git a/backend/api/v1/modules/a76/general_catalogs/fractions/us_tariff_fractions/routes.py b/backend/api/v1/modules/a76/general_catalogs/fractions/us_tariff_fractions/routes.py index acda6661..b5130e55 100644 --- a/backend/api/v1/modules/a76/general_catalogs/fractions/us_tariff_fractions/routes.py +++ b/backend/api/v1/modules/a76/general_catalogs/fractions/us_tariff_fractions/routes.py @@ -103,7 +103,7 @@ async def list_us_tariff_fractions( search_description = search try: - sitar_items = await svc.search( + sitar_items, total = await svc.search_with_total( fraccion=search_term, descripcion=search_description, skip=skip, @@ -118,10 +118,6 @@ async def list_us_tariff_fractions( "pages": 0, } - total = len(sitar_items) + skip - if len(sitar_items) == page_size: - total += 1 - items = [ USTariffFractionResponseDTO.model_validate(_sitar_row_to_us_response_payload(row)) for row in sitar_items diff --git a/backend/api/v1/modules/core/tasks_tracking/dispatch.py b/backend/api/v1/modules/core/tasks_tracking/dispatch.py index a0f60d87..99ea371f 100644 --- a/backend/api/v1/modules/core/tasks_tracking/dispatch.py +++ b/backend/api/v1/modules/core/tasks_tracking/dispatch.py @@ -3,7 +3,7 @@ from typing import Any from celery import Task from sqlalchemy.orm import Session -from core.database import rls_company_var, rls_tenant_var +from core.database import reset_rls_context_tokens, rls_company_var, rls_tenant_var from .service import TaskTrackerService @@ -39,8 +39,7 @@ def track_and_dispatch( headers=headers, ) finally: - rls_tenant_var.reset(token_t) - rls_company_var.reset(token_c) + reset_rls_context_tokens(token_t, token_c) tracker = TaskTrackerService(db) tracker.register_dispatch( diff --git a/backend/api/v1/modules/sitar/common/base_service.py b/backend/api/v1/modules/sitar/common/base_service.py index a8e1f077..05d104ca 100644 --- a/backend/api/v1/modules/sitar/common/base_service.py +++ b/backend/api/v1/modules/sitar/common/base_service.py @@ -6,7 +6,7 @@ All specific resource services inherit from this. """ import os -from typing import Optional, Dict, Any +from typing import Optional, Dict, Any, List, Tuple from datetime import datetime, timedelta import httpx @@ -17,6 +17,29 @@ class SitarAPIBaseService: _token: Optional[str] = None _token_expires: Optional[datetime] = None + @staticmethod + def _parse_paginated_list_and_total(data: Any) -> Tuple[List[Any], int]: + """ + Paginated list endpoints (fracciones, fracciones-usa) return: + { "data": [...], "total", "page", "limit", "total_pages" }. + Older responses may be a plain JSON array; then total is len(rows) for that page only. + """ + if isinstance(data, list): + return data, len(data) + if isinstance(data, dict) and isinstance(data.get("data"), list): + rows = data["data"] + raw_total = data.get("total") + total = int(raw_total) if raw_total is not None else len(rows) + return rows, total + raise ValueError( + f"Unexpected SITAR list response shape: {type(data).__name__}" + ) + + @staticmethod + def _unwrap_paginated_list(data: Any) -> List[Any]: + rows, _ = SitarAPIBaseService._parse_paginated_list_and_total(data) + return rows + def __init__(self): """Initialize base service with API credentials""" self.base_url = os.getenv("SITAR_API_URL") diff --git a/backend/api/v1/modules/sitar/fracciones/service.py b/backend/api/v1/modules/sitar/fracciones/service.py index ada6de61..cf848f1d 100644 --- a/backend/api/v1/modules/sitar/fracciones/service.py +++ b/backend/api/v1/modules/sitar/fracciones/service.py @@ -1,7 +1,7 @@ """Fracciones Service""" import asyncio -from typing import Optional, List +from typing import Optional, List, Tuple from ..common import SitarAPIBaseService from .schemas import FraccionesResponse @@ -18,7 +18,7 @@ class FraccionesService(SitarAPIBaseService): cls._instance = cls() return cls._instance - async def search( + async def search_with_total( self, fraccion: Optional[str] = None, nico: Optional[str] = None, @@ -26,8 +26,8 @@ class FraccionesService(SitarAPIBaseService): nivel: Optional[int] = None, skip: int = 0, limit: int = 100, - ) -> List[FraccionesResponse]: - """Search Mexican tariff fractions""" + ) -> Tuple[List[FraccionesResponse], int]: + """Search Mexican tariff fractions; total matches SITAR PaginatedFraccionesResponse.total.""" params = {"skip": skip, "limit": min(limit, 1000)} if fraccion: params["fraccion"] = fraccion @@ -38,8 +38,29 @@ class FraccionesService(SitarAPIBaseService): if nivel is not None: params["nivel"] = nivel - data = await self._make_request("GET", "/api/v1/fracciones/", params=params) - return [FraccionesResponse(**item) for item in data] + raw = await self._make_request("GET", "/api/v1/fracciones/", params=params) + rows, total = self._parse_paginated_list_and_total(raw) + return [FraccionesResponse(**item) for item in rows], total + + async def search( + self, + fraccion: Optional[str] = None, + nico: Optional[str] = None, + description: Optional[str] = None, + nivel: Optional[int] = None, + skip: int = 0, + limit: int = 100, + ) -> List[FraccionesResponse]: + """Search Mexican tariff fractions""" + items, _ = await self.search_with_total( + fraccion=fraccion, + nico=nico, + description=description, + nivel=nivel, + skip=skip, + limit=limit, + ) + return items async def get_by_id(self, sysid: int) -> FraccionesResponse: """Get single Fraccion record by SYSID""" diff --git a/backend/api/v1/modules/sitar/fracciones_usa/service.py b/backend/api/v1/modules/sitar/fracciones_usa/service.py index fe4b513c..56608c61 100644 --- a/backend/api/v1/modules/sitar/fracciones_usa/service.py +++ b/backend/api/v1/modules/sitar/fracciones_usa/service.py @@ -1,7 +1,7 @@ """Fracciones USA Service""" import logging -from typing import Optional, List +from typing import Optional, List, Tuple from ..common import SitarAPIBaseService from .schemas import FraccionesUSAResponse @@ -22,6 +22,24 @@ class FraccionesUSAService(SitarAPIBaseService): cls._instance = cls() return cls._instance + async def search_with_total( + self, + fraccion: Optional[str] = None, + descripcion: Optional[str] = None, + skip: int = 0, + limit: int = 100, + ) -> Tuple[List[FraccionesUSAResponse], int]: + """Search USA tariff fractions; total matches SITAR PaginatedFraccionesUSAResponse.total.""" + params = {"skip": skip, "limit": min(limit, 1000)} + if fraccion: + params["fraccion"] = fraccion + if descripcion: + params["descripcion"] = descripcion + + raw = await self._make_request("GET", "api/v1/fracciones-usa/", params=params) + rows, total = self._parse_paginated_list_and_total(raw) + return [FraccionesUSAResponse(**item) for item in rows], total + async def search( self, fraccion: Optional[str] = None, @@ -30,14 +48,13 @@ class FraccionesUSAService(SitarAPIBaseService): limit: int = 100, ) -> List[FraccionesUSAResponse]: """Search USA tariff fractions""" - params = {"skip": skip, "limit": min(limit, 1000)} - if fraccion: - params["fraccion"] = fraccion - if descripcion: - params["descripcion"] = descripcion - - data = await self._make_request("GET", "api/v1/fracciones-usa/", params=params) - return [FraccionesUSAResponse(**item) for item in data] + items, _ = await self.search_with_total( + fraccion=fraccion, + descripcion=descripcion, + skip=skip, + limit=limit, + ) + return items async def get_by_id(self, consecutivo: int) -> FraccionesUSAResponse: """Get single USA Fraccion record by CONSECUTIVO""" @@ -68,10 +85,9 @@ class FraccionesUSAService(SitarAPIBaseService): params["descripcion"] = descripcion try: - data = service._make_request_sync("GET", "api/v1/fracciones-usa/", params=params) - if not isinstance(data, list): - return [] - return [FraccionesUSAResponse(**item) for item in data] + raw = service._make_request_sync("GET", "api/v1/fracciones-usa/", params=params) + rows, _ = service._parse_paginated_list_and_total(raw) + return [FraccionesUSAResponse(**item) for item in rows] except Exception as exc: logger.warning("SITAR fracciones-usa search_sync failed: %s", exc) return [] diff --git a/backend/api/v1/modules/sitar/openapi/README.md b/backend/api/v1/modules/sitar/openapi/README.md new file mode 100644 index 00000000..25a68fac --- /dev/null +++ b/backend/api/v1/modules/sitar/openapi/README.md @@ -0,0 +1,10 @@ +# SITAR API — especificación OpenAPI rescatada + +| Campo | Valor | +|-------|--------| +| Fuente | `GET http://api.sitar.aduanasoft.com:880/fractions/api/v1/openapi.json` | +| UI Swagger | `http://api.sitar.aduanasoft.com:880/fractions/docs` | +| Rescatado | 2026-05-08 | +| Archivo | [sitar-api-openapi-3.1.json](sitar-api-openapi-3.1.json) (OpenAPI 3.1, «SITAR API - DEV») | + +Las rutas documentadas usan prefijo `/api/v1/...`. Las peticiones desde este proyecto anteponen `{SITAR_API_URL}/fractions/` (ver `SitarAPIBaseService`), por ejemplo: `{SITAR_API_URL}/fractions/api/v1/tlcs/`. diff --git a/backend/api/v1/modules/sitar/openapi/sitar-api-openapi-3.1.json b/backend/api/v1/modules/sitar/openapi/sitar-api-openapi-3.1.json new file mode 100644 index 00000000..8437d53a --- /dev/null +++ b/backend/api/v1/modules/sitar/openapi/sitar-api-openapi-3.1.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"SITAR API - DEV","description":"FastAPI application with SQL Server integration","version":"1.0.0"},"paths":{"/api/v1/auth/login":{"post":{"tags":["authentication"],"summary":"Login","description":"Login endpoint - Authenticate user and return JWT token\n\nArgs:\n credentials: Login credentials (username and password)\n \nReturns:\n Access token (Bearer token)\n \nRaises:\n HTTPException: If credentials are invalid","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["authentication"],"summary":"Get Current User Info","description":"Get current authenticated user information\nEndpoint protegido que requiere un token válido\n\nArgs:\n current_user: Username extracted from JWT token\n \nReturns:\n Current user information","operationId":"get_current_user_info_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/aladi2/":{"get":{"tags":["aladi2"],"summary":"Search Aladi2","description":"Search Aladi2 records by FRACCION and/or NICO\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/aladi2?fraccion=8471600101`\n- Solo NICO: `/aladi2?nico=01`\n- Ambos: `/aladi2?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/aladi2?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_aladi2_api_v1_aladi2__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Aladi2Response"},"title":"Response Search Aladi2 Api V1 Aladi2 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/aladi2/{sysid}":{"get":{"tags":["aladi2"],"summary":"Get Aladi2 By Id","description":"Get a single Aladi2 record by SYSID\n\n- **sysid**: ID del registro","operationId":"get_aladi2_by_id_api_v1_aladi2__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Aladi2Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cuotas2/":{"get":{"tags":["cuotas2"],"summary":"Search Cuotas2","description":"Search Cuotas2 records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/cuotas2?fraccion=8471600101`\n- Solo NICO: `/cuotas2?nico=01`\n- Ambos: `/cuotas2?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/cuotas2?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_cuotas2_api_v1_cuotas2__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Cuotas2Response"},"title":"Response Search Cuotas2 Api V1 Cuotas2 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cuotas2/{sysid}":{"get":{"tags":["cuotas2"],"summary":"Get Cuotas2 By Id","description":"Get a single Cuotas2 record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_cuotas2_by_id_api_v1_cuotas2__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cuotas2Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cupos/":{"get":{"tags":["cupos"],"summary":"Search Cupos","description":"Search Cupos records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/cupos?fraccion=8471600101`\n- Solo NICO: `/cupos?nico=01`\n- Ambos: `/cupos?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/cupos?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_cupos_api_v1_cupos__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CuposResponse"},"title":"Response Search Cupos Api V1 Cupos Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cupos/{sysid}":{"get":{"tags":["cupos"],"summary":"Get Cupos By Id","description":"Get a single Cupos record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_cupos_by_id_api_v1_cupos__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CuposResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones/":{"get":{"tags":["fracciones"],"summary":"Search Fracciones","description":"Search Fracciones records by FRACCION and/or NICO\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **nivel**: Nivel de la fracción (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/fracciones?fraccion=8471600101`\n- Solo NICO: `/fracciones?nico=01`\n- Solo nivel: `/fracciones?nivel=4`\n- Ambos: `/fracciones?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/fracciones?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_fracciones_api_v1_fracciones__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"nivel","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Nivel de la fracción (opcional)","title":"Nivel"},"description":"Nivel de la fracción (opcional)"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedFraccionesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones/{sysid}":{"get":{"tags":["fracciones"],"summary":"Get Fracciones By Id","description":"Get a single Fracciones record by SYSID\n\n- **sysid**: ID del registro","operationId":"get_fracciones_by_id_api_v1_fracciones__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraccionesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones-usa/":{"get":{"tags":["fracciones-usa"],"summary":"Search Fracciones Usa","description":"Search Fracciones USA records by FRACCION\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (busca en FRACCION_SIN_PUNTO, FRACCION_CON_PUNTO y FRACCION_MOSTRAR)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nEjemplos:\n- `/fracciones-usa?fraccion=8471600101`\n- `/fracciones-usa?fraccion=8471.60.01.01`\n- `/fracciones-usa?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_fracciones_usa_api_v1_fracciones_usa__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedFraccionesUSAResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones-usa/{consecutivo}":{"get":{"tags":["fracciones-usa"],"summary":"Get Fracciones Usa By Id","description":"Get a single Fracciones USA record by CONSECUTIVO\n\n**Requiere autenticación Bearer token**\n\n- **consecutivo**: ID del registro","operationId":"get_fracciones_usa_by_id_api_v1_fracciones_usa__consecutivo__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"consecutivo","in":"path","required":true,"schema":{"type":"integer","title":"Consecutivo"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraccionesUSAResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones-anteriores/":{"get":{"tags":["fracciones-anteriores"],"summary":"Search Fracciones Anteriores","description":"Search Fracciones Anteriores records by FRACCIONACTUAL and/or FRACCIONANTERIOR\n\n**Requiere autenticación Bearer token**\n\n- **fraccion_actual**: Fracción actual (opcional)\n- **fraccion_anterior**: Fracción anterior (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción actual: `/fracciones-anteriores?fraccion_actual=8471600101`\n- Solo fracción anterior: `/fracciones-anteriores?fraccion_anterior=8471600101`\n- Ambas: `/fracciones-anteriores?fraccion_actual=8471600101&fraccion_anterior=8471600102`\n- Todos (con paginación): `/fracciones-anteriores?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_fracciones_anteriores_api_v1_fracciones_anteriores__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion_actual","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción actual a buscar","title":"Fraccion Actual"},"description":"Fracción actual a buscar"},{"name":"fraccion_anterior","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción anterior a buscar","title":"Fraccion Anterior"},"description":"Fracción anterior a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FraccionesAnterioresResponse"},"title":"Response Search Fracciones Anteriores Api V1 Fracciones Anteriores Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fracciones-anteriores/{sysid}":{"get":{"tags":["fracciones-anteriores"],"summary":"Get Fracciones Anteriores By Id","description":"Get a single Fracciones Anteriores record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_fracciones_anteriores_by_id_api_v1_fracciones_anteriores__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraccionesAnterioresResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fundamentos-tlc/":{"get":{"tags":["fundamentos-tlc"],"summary":"Search Fundamentos Tlc","description":"Search Fundamentos TLC records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/fundamentos-tlc?fraccion=84716001`\n- Solo NICO: `/fundamentos-tlc?nico=01`\n- Ambos: `/fundamentos-tlc?fraccion=84716001&nico=01`\n- Todos (con paginación): `/fundamentos-tlc?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_fundamentos_tlc_api_v1_fundamentos_tlc__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FundamentosTLCResponse"},"title":"Response Search Fundamentos Tlc Api V1 Fundamentos Tlc Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fundamentos-tlc/tipat":{"get":{"tags":["fundamentos-tlc"],"summary":"Search Fundamentos Tlc Tipat","description":"Search Fundamentos TLC records by FRACCION and/or NICO where FUNDAMENTO2 = 'TIPAT'\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/fundamentos-tlc/tipat?fraccion=84716001`\n- Solo NICO: `/fundamentos-tlc/tipat?nico=01`\n- Ambos: `/fundamentos-tlc/tipat?fraccion=84716001&nico=01`\n- Todos con TIPAT (con paginación): `/fundamentos-tlc/tipat?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)\n\nTodos los resultados tendrán FUNDAMENTO2 = 'TIPAT'","operationId":"search_fundamentos_tlc_tipat_api_v1_fundamentos_tlc_tipat_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FundamentosTLCResponse"},"title":"Response Search Fundamentos Tlc Tipat Api V1 Fundamentos Tlc Tipat Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fundamentos-tlc/{sysid}":{"get":{"tags":["fundamentos-tlc"],"summary":"Get Fundamentos Tlc By Id","description":"Get a single Fundamentos TLC record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_fundamentos_tlc_by_id_api_v1_fundamentos_tlc__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundamentosTLCResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/informacion-general/":{"get":{"tags":["informacion-general"],"summary":"Search Informacion General","description":"Search Informacion General records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/informacion-general?fraccion=8471600101`\n- Solo NICO: `/informacion-general?nico=01`\n- Ambos: `/informacion-general?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/informacion-general?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_informacion_general_api_v1_informacion_general__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InformacionGeneralResponse"},"title":"Response Search Informacion General Api V1 Informacion General Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/informacion-general/{sysid}":{"get":{"tags":["informacion-general"],"summary":"Get Informacion General By Id","description":"Get a single Informacion General record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_informacion_general_by_id_api_v1_informacion_general__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InformacionGeneralResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/precios-estimados2/":{"get":{"tags":["precios-estimados2"],"summary":"Search Precios Estimados2","description":"Search Precios Estimados records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/precios-estimados2?fraccion=8471600101`\n- Solo NICO: `/precios-estimados2?nico=01`\n- Ambos: `/precios-estimados2?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/precios-estimados2?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_precios_estimados2_api_v1_precios_estimados2__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PreciosEstimados2Response"},"title":"Response Search Precios Estimados2 Api V1 Precios Estimados2 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/precios-estimados2/{sysid}":{"get":{"tags":["precios-estimados2"],"summary":"Get Precios Estimados2 By Id","description":"Get a single Precios Estimados record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_precios_estimados2_by_id_api_v1_precios_estimados2__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreciosEstimados2Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/prosec/":{"get":{"tags":["prosec"],"summary":"Search Prosec","description":"Search Prosec records by FRACCION, NICO, SECTOR and/or ARTICULO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **sector**: Sector (opcional)\n- **articulo**: Artículo (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/prosec?fraccion=8471600101`\n- Solo NICO: `/prosec?nico=01`\n- Solo sector: `/prosec?sector=01`\n- Solo artículo: `/prosec?articulo=001`\n- Combinaciones: `/prosec?fraccion=8471600101§or=01&articulo=001`\n- Todos (con paginación): `/prosec?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_prosec_api_v1_prosec__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"sector","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sector a buscar","title":"Sector"},"description":"Sector a buscar"},{"name":"articulo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Artículo a buscar","title":"Articulo"},"description":"Artículo a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProsecResponse"},"title":"Response Search Prosec Api V1 Prosec Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/prosec/{sysid}":{"get":{"tags":["prosec"],"summary":"Get Prosec By Id","description":"Get a single Prosec record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_prosec_by_id_api_v1_prosec__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProsecResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rcg2/":{"get":{"tags":["rcg2"],"summary":"Search Rcg2","description":"Search RCG2 records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/rcg2?fraccion=8471600101`\n- Solo NICO: `/rcg2?nico=01`\n- Ambos: `/rcg2?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/rcg2?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_rcg2_api_v1_rcg2__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RCG2Response"},"title":"Response Search Rcg2 Api V1 Rcg2 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rcg2/{sysid}":{"get":{"tags":["rcg2"],"summary":"Get Rcg2 By Id","description":"Get a single RCG2 record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_rcg2_by_id_api_v1_rcg2__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RCG2Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reit/":{"get":{"tags":["reit"],"summary":"Search Reit","description":"Search REIT records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/reit?fraccion=8471600101`\n- Solo NICO: `/reit?nico=01`\n- Ambos: `/reit?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/reit?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_reit_api_v1_reit__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/REITResponse"},"title":"Response Search Reit Api V1 Reit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reit/{sysid}":{"get":{"tags":["reit"],"summary":"Get Reit By Id","description":"Get a single REIT record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_reit_by_id_api_v1_reit__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/REITResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/requisito-previo/":{"get":{"tags":["requisito-previo"],"summary":"Search Requisito Previo","description":"Search RequisitoPrevio records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/requisito-previo?fraccion=84716001`\n- Solo NICO: `/requisito-previo?nico=01`\n- Ambos: `/requisito-previo?fraccion=84716001&nico=01`\n- Todos (con paginación): `/requisito-previo?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_requisito_previo_api_v1_requisito_previo__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RequisitoPrevioResponse"},"title":"Response Search Requisito Previo Api V1 Requisito Previo Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/requisito-previo/{sysid}":{"get":{"tags":["requisito-previo"],"summary":"Get Requisito Previo By Id","description":"Get a single RequisitoPrevio record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_requisito_previo_by_id_api_v1_requisito_previo__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequisitoPrevioResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tlcs/":{"get":{"tags":["tlcs"],"summary":"Search Tlcs","description":"Search TLCS records by FRACCION, PAIS and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **pais**: Código de país (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/tlcs?fraccion=8471600101`\n- Solo país: `/tlcs?pais=USA`\n- Solo NICO: `/tlcs?nico=01`\n- Combinaciones: `/tlcs?fraccion=8471600101&pais=USA&nico=01`\n- Todos (con paginación): `/tlcs?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_tlcs_api_v1_tlcs__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"pais","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Código de país a buscar","title":"Pais"},"description":"Código de país a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TLCSResponse"},"title":"Response Search Tlcs Api V1 Tlcs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tlcs/{sysid}/{fraccion}":{"get":{"tags":["tlcs"],"summary":"Get Tlcs By Id","description":"Get a single TLCS record by SYSID and FRACCION (composite key)\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro\n- **fraccion**: Fracción arancelaria","operationId":"get_tlcs_by_id_api_v1_tlcs__sysid___fraccion__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}},{"name":"fraccion","in":"path","required":true,"schema":{"type":"string","title":"Fraccion"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TLCSResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vehiculos-marcas/":{"get":{"tags":["vehiculos-marcas"],"summary":"Search Vehiculos Marcas","description":"Search VehiculosMarcas records by FRACCION\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Fracción: `/vehiculos-marcas?fraccion=87032301`\n- Todos (con paginación): `/vehiculos-marcas?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_vehiculos_marcas_api_v1_vehiculos_marcas__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VehiculosMarcasResponse"},"title":"Response Search Vehiculos Marcas Api V1 Vehiculos Marcas Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vehiculos-marcas/{sysid}":{"get":{"tags":["vehiculos-marcas"],"summary":"Get Vehiculos Marcas By Id","description":"Get a single VehiculosMarcas record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_vehiculos_marcas_by_id_api_v1_vehiculos_marcas__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehiculosMarcasResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vehiculos-modelos/":{"get":{"tags":["vehiculos-modelos"],"summary":"Search Vehiculos Modelos","description":"Search VehiculosModelos records by FRACCION\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Fracción: `/vehiculos-modelos?fraccion=87032301`\n- Todos (con paginación): `/vehiculos-modelos?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_vehiculos_modelos_api_v1_vehiculos_modelos__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VehiculosModelosResponse"},"title":"Response Search Vehiculos Modelos Api V1 Vehiculos Modelos Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/vehiculos-modelos/{sysid}":{"get":{"tags":["vehiculos-modelos"],"summary":"Get Vehiculos Modelos By Id","description":"Get a single VehiculosModelos record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_vehiculos_modelos_by_id_api_v1_vehiculos_modelos__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehiculosModelosResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/regulaciones/":{"get":{"tags":["regulaciones"],"summary":"Search Regulaciones","description":"Search Regulaciones records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/regulaciones?fraccion=8471600101`\n- Solo NICO: `/regulaciones?nico=01`\n- Ambos: `/regulaciones?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/regulaciones?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_regulaciones_api_v1_regulaciones__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RegulacionesResponse"},"title":"Response Search Regulaciones Api V1 Regulaciones Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/regulaciones/{sysid}":{"get":{"tags":["regulaciones"],"summary":"Get Regulaciones By Id","description":"Get a single Regulaciones record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_regulaciones_by_id_api_v1_regulaciones__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegulacionesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ieps/":{"get":{"tags":["ieps"],"summary":"Search Ieps","description":"Search IEPS records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (busca en FRACCION_SIN_PUNTO y FRACCION_CON_PUNTO, opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/ieps?fraccion=2207101099`\n- Solo NICO: `/ieps?nico=01`\n- Ambos: `/ieps?fraccion=2207101099&nico=01`\n- Todos (con paginación): `/ieps?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_ieps_api_v1_ieps__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar (busca en ambos campos: con y sin punto)","title":"Fraccion"},"description":"Fracción arancelaria a buscar (busca en ambos campos: con y sin punto)"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IEPSResponse"},"title":"Response Search Ieps Api V1 Ieps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ieps/{consecutivo}":{"get":{"tags":["ieps"],"summary":"Get Ieps By Id","description":"Get a single IEPS record by CONSECUTIVO\n\n**Requiere autenticación Bearer token**\n\n- **consecutivo**: ID del registro","operationId":"get_ieps_by_id_api_v1_ieps__consecutivo__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"consecutivo","in":"path","required":true,"schema":{"type":"integer","title":"Consecutivo"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IEPSResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/noms/":{"get":{"tags":["noms"],"summary":"Search Noms","description":"Search Noms records by FRACCION and/or NICO\n\n**Requiere autenticación Bearer token**\n\n- **fraccion**: Fracción arancelaria (opcional)\n- **nico**: NICO (opcional)\n- **skip**: Paginación - registros a saltar (default: 0)\n- **limit**: Paginación - máximo de registros (default: 100, max: 1000)\n\nPuedes buscar por:\n- Solo fracción: `/noms?fraccion=8471600101`\n- Solo NICO: `/noms?nico=01`\n- Ambos: `/noms?fraccion=8471600101&nico=01`\n- Todos (con paginación): `/noms?limit=50`\n\nDevuelve una lista que puede contener:\n- 0 elementos (sin resultados)\n- 1 elemento (resultado único)\n- N elementos (múltiples resultados)","operationId":"search_noms_api_v1_noms__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fraccion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fracción arancelaria a buscar","title":"Fraccion"},"description":"Fracción arancelaria a buscar"},{"name":"nico","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"NICO a buscar","title":"Nico"},"description":"NICO a buscar"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Número de registros a saltar","default":0,"title":"Skip"},"description":"Número de registros a saltar"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Máximo de registros a devolver","default":100,"title":"Limit"},"description":"Máximo de registros a devolver"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NomsResponse"},"title":"Response Search Noms Api V1 Noms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/noms/{sysid}":{"get":{"tags":["noms"],"summary":"Get Noms By Id","description":"Get a single Noms record by SYSID\n\n**Requiere autenticación Bearer token**\n\n- **sysid**: ID del registro","operationId":"get_noms_by_id_api_v1_noms__sysid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sysid","in":"path","required":true,"schema":{"type":"integer","title":"Sysid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NomsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Aladi2Response":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"ACUERDO":{"anyOf":[{"type":"string","maxLength":49},{"type":"null"}],"title":"Acuerdo"},"PAIS":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Pais"},"TASATXT":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Tasatxt"},"TASANUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasanum"},"TASACALCULADA":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Tasacalculada"},"TIPOTASA":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasa"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"NOTAS":{"anyOf":[{"type":"string","maxLength":499},{"type":"null"}],"title":"Notas"},"OBSERVACIONES":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observaciones"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico"},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"Aladi2Response","description":"Schema for Aladi2 response"},"Cuotas2Response":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"PRODUCTO":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Producto"},"PAIS":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Pais"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"DOF2":{"anyOf":[{"type":"string","maxLength":149},{"type":"null"}],"title":"Dof2"},"EMPRESA":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Empresa"},"INCOTERM":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Incoterm"},"DOLARES":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dolares"},"CLAVEMONEDA":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Clavemoneda"},"CLAVEUM":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Claveum"},"PORCENTAJE":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Porcentaje"},"DESCRIPCIONDOLARES":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Descripciondolares"},"NOTAS":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notas"},"ESTATUS":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Estatus"},"NUMERORESOLUCION":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numeroresolucion"},"RESOLUCION":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Resolucion"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"Cuotas2Response","description":"Schema for Cuotas2 response"},"CuposResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"NUMEROCUPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numerocupo"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"PERMISO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Permiso"},"CONDICION":{"anyOf":[{"type":"string","maxLength":199},{"type":"null"}],"title":"Condicion"},"VIGENCIA":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Vigencia"},"PAIS":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Pais"},"OBSERVACIONES":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Observaciones"},"ADVIMPO":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Advimpo"},"ADVEXPO":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Advexpo"},"TIPOOPERACION":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipooperacion"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"CuposResponse","description":"Schema for Cupos response"},"FraccionesAnterioresResponse":{"properties":{"FRACCIONACTUAL":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccionactual"},"FRACCIONANTERIOR":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccionanterior"},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"FraccionesAnterioresResponse","description":"Schema for FraccionesAnteriores response"},"FraccionesResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"FRACCIONPUNTO":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccionpunto"},"DESCRIPCION":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Descripcion"},"UMCLAVE":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Umclave"},"UMABREVIACION":{"anyOf":[{"type":"string","maxLength":4},{"type":"null"}],"title":"Umabreviacion"},"ADVIMPOTXT":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Advimpotxt"},"ADVIMPONUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advimponum"},"TIPOTASAADVIMPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasaadvimpo"},"ADVEXPOTXT":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Advexpotxt"},"ADVEXPONUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advexponum"},"TIPOTASAADVEXPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasaadvexpo"},"TASAIVAFRANJA":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasaivafranja"},"TASAIVAINTERIOR":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasaivainterior"},"TASAISAN":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasaisan"},"ARANCELMIXTO":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Arancelmixto"},"TASAMIXTA":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasamixta"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"NOTAS":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notas"},"HISTORICO":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Historico"},"ARANCELESPECIFICO":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Arancelespecifico"},"TIPOVEHICULO":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Tipovehiculo"},"APLICAISAN":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Aplicaisan"},"APLICAIEPS":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Aplicaieps"},"NIVEL":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nivel"},"NICO":{"anyOf":[{"type":"string","maxLength":14},{"type":"null"}],"title":"Nico"},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"FraccionesResponse","description":"Schema for Fracciones response"},"FraccionesUSAResponse":{"properties":{"FRACCION_SIN_PUNTO":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Fraccion Sin Punto"},"FRACCION_CON_PUNTO":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Fraccion Con Punto"},"FRACCION_MOSTRAR":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Fraccion Mostrar"},"ESPECIFICO":{"anyOf":[{"type":"string","maxLength":4},{"type":"null"}],"title":"Especifico"},"NIVEL":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nivel"},"DESCRIPCION":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Descripcion"},"UNIDADCANTIDAD":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Unidadcantidad"},"TARIFA1":{"anyOf":[{"type":"string","maxLength":250},{"type":"null"}],"title":"Tarifa1"},"TLC":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Tlc"},"TARIFA2":{"anyOf":[{"type":"string","maxLength":250},{"type":"null"}],"title":"Tarifa2"},"NOTAS":{"anyOf":[{"type":"string","maxLength":7998},{"type":"null"}],"title":"Notas"},"CONSECUTIVO":{"type":"integer","title":"Consecutivo"}},"type":"object","required":["CONSECUTIVO"],"title":"FraccionesUSAResponse","description":"Schema for FraccionesUSA response"},"FundamentosTLCResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Fraccion"},"PAIS":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Pais"},"TASATXT":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Tasatxt"},"TIPOTASA":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasa"},"TASA1NUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasa1Num"},"TASA2NUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasa2Num"},"FUNDAMENTO1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fundamento1"},"FUNDAMENTO2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fundamento2"},"PERIODO":{"anyOf":[{"type":"string","maxLength":299},{"type":"null"}],"title":"Periodo"},"MODALIDAD":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Modalidad"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"NOTAS":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Notas"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"FundamentosTLCResponse","description":"Schema for FundamentosTLC response"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IEPSResponse":{"properties":{"FRACCION_SIN_PUNTO":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion Sin Punto"},"FRACCION_CON_PUNTO":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion Con Punto"},"FUNDAMENTO":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Fundamento"},"CONDICION":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Condicion"},"TASA":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasa"},"TASAESPECIFICO":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasaespecifico"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"CONSECUTIVO":{"type":"integer","title":"Consecutivo"}},"type":"object","required":["CONSECUTIVO"],"title":"IEPSResponse","description":"Schema for IEPS response"},"InformacionGeneralResponse":{"properties":{"OBSERVACIONES":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Observaciones"},"NOTAOBSERVACIONES":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notaobservaciones"},"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"TIPOOPERACION":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipooperacion"},"ORDEN":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Orden"},"LEYENDA":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leyenda"},"NOTA":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nota"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"InformacionGeneralResponse","description":"Schema for InformacionGeneral response"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginRequest","description":"Schema for login request"},"NomsResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion","default":""},"IMPORTACION":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Importacion","default":""},"EXPORTACION":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Exportacion","default":""},"PERMISO":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Permiso","default":""},"ACUERDO":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Acuerdo","default":""},"CONDICION":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condicion","default":""},"FUNDAMENTO":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fundamento","default":""},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof","default":""},"FORMATONOM":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Formatonom","default":""},"INSTRUCCIONES":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Instrucciones","default":""},"CRITERIO":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}],"title":"Criterio","default":""},"COMPLEMENTO":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Complemento","default":""},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"PAIS":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Pais","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"NomsResponse","description":"Schema for Noms response"},"PaginatedFraccionesResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FraccionesResponse"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total","description":"Total de registros que coinciden con la búsqueda"},"page":{"type":"integer","title":"Page","description":"Página actual (base 1)"},"limit":{"type":"integer","title":"Limit","description":"Registros por página"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total de páginas"}},"type":"object","required":["data","total","page","limit","total_pages"],"title":"PaginatedFraccionesResponse","description":"Paginated response wrapper for Fracciones"},"PaginatedFraccionesUSAResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FraccionesUSAResponse"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total","description":"Total de registros que coinciden con la búsqueda"},"page":{"type":"integer","title":"Page","description":"Página actual (base 1)"},"limit":{"type":"integer","title":"Limit","description":"Registros por página"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total de páginas"}},"type":"object","required":["data","total","page","limit","total_pages"],"title":"PaginatedFraccionesUSAResponse","description":"Paginated response wrapper for FraccionesUSA"},"PreciosEstimados2Response":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"DESCRIPCION":{"anyOf":[{"type":"string","maxLength":499},{"type":"null"}],"title":"Descripcion"},"CLAVEUM":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Claveum"},"PRECIOESTIMADODLLS":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Precioestimadodlls"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"OBSERVACION1":{"anyOf":[{"type":"string","maxLength":1999},{"type":"null"}],"title":"Observacion1"},"OBSERVACION2":{"anyOf":[{"type":"string","maxLength":1999},{"type":"null"}],"title":"Observacion2"},"RESOLUCION":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Resolucion"},"REGLA":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Regla"},"WEB_DOCUMENTO_ID_RES":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Documento Id Res"},"WEB_DOCUMENTO_ID_REG":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Documento Id Reg"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"PreciosEstimados2Response","description":"Schema for PreciosEstimados2 response"},"ProsecResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion","default":""},"ARTICULO":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Articulo","default":""},"SECTOR":{"anyOf":[{"type":"string","maxLength":6},{"type":"null"}],"title":"Sector","default":""},"TASATXT":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Tasatxt","default":""},"TASANUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasanum","default":"0"},"TIPOTASA":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasa","default":0},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof","default":""},"OBSERVACION":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observacion","default":""},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"ProsecResponse","description":"Schema for Prosec response"},"RCG2Response":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"ANEXO":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Anexo"},"SECTOR":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"REGIMEN":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regimen"},"CONDICION":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condicion"},"ADUANAS":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Aduanas"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"ARCHIVOCRITERIO":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Archivocriterio"},"TIPO":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Tipo"},"IMPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Impo"},"EXPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expo"},"WEB_DOCUMENTO_ID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Documento Id"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"RCG2Response","description":"Schema for RCG2 response"},"REITResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"ARTICULO":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Articulo"},"FUNDAMENTO":{"anyOf":[{"type":"string","maxLength":1500},{"type":"null"}],"title":"Fundamento"},"ACUERDO":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Acuerdo"},"PERMISO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Permiso"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"DOCUMENTO":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Documento"},"TEMPORALIDAD":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Temporalidad"},"TEMPORALIDADSERVICIO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Temporalidadservicio"},"TEMPORALIDADCERTIFICADA":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Temporalidadcertificada"},"WEB_DOCUMENTO_ID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Documento Id"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"REITResponse","description":"Schema for REIT response"},"RegulacionesResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Fraccion"},"IMPORTACION":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Importacion"},"EXPORTACION":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Exportacion"},"PERMISO":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Permiso"},"ACUERDO":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Acuerdo"},"CONDICION":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condicion"},"FUNDAMENTO":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fundamento"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"FORMATONOM":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Formatonom"},"INSTRUCCIONES":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Instrucciones"},"CRITERIO":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}],"title":"Criterio"},"COMPLEMENTO":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Complemento"},"CRITERIOESPECIAL":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Criterioespecial"},"PAIS":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Pais"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"RegulacionesResponse","description":"Schema for Regulaciones response"},"RequisitoPrevioResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Fraccion"},"DESCRIPCION":{"anyOf":[{"type":"string","maxLength":1999},{"type":"null"}],"title":"Descripcion"},"OBSERVACION":{"anyOf":[{"type":"string","maxLength":1999},{"type":"null"}],"title":"Observacion"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"VIGENCIA":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Vigencia"},"NUMEROACUERDO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numeroacuerdo"},"NUMEROCRITERIO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numerocriterio"},"NUMEROFORMATO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numeroformato"},"NUMEROINSTRUCCIONES":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numeroinstrucciones"},"HISTORICO":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Historico"},"NOTA":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Nota"},"PERMISO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Permiso"},"IMPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Impo"},"EXPO":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expo"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"RequisitoPrevioResponse","description":"Schema for RequisitoPrevio response"},"TLCSResponse":{"properties":{"FRACCION":{"type":"string","maxLength":10,"title":"Fraccion"},"PAIS":{"type":"string","maxLength":3,"title":"Pais"},"ORDEN":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Orden"},"TASATXT":{"anyOf":[{"type":"string","maxLength":44},{"type":"null"}],"title":"Tasatxt"},"TIPOTASA":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tipotasa"},"TASA1NUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasa1Num"},"FACTOR1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Factor1"},"TASA2NUM":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasa2Num"},"FACTOR2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Factor2"},"DOF":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Dof"},"NOTAS":{"anyOf":[{"type":"string","maxLength":999},{"type":"null"}],"title":"Notas"},"NICO":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Nico","default":""},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["FRACCION","PAIS","SYSID"],"title":"TLCSResponse","description":"Schema for TLCS response"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token","description":"Schema for token response"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VehiculosMarcasResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Fraccion"},"MARCA":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Marca"},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"VehiculosMarcasResponse","description":"Schema for VehiculosMarcas response"},"VehiculosModelosResponse":{"properties":{"FRACCION":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Fraccion"},"MARCA":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Marca"},"MODELO":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Modelo"},"TIPO":{"anyOf":[{"type":"string","maxLength":1},{"type":"null"}],"title":"Tipo"},"CLAVEUM":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Claveum"},"A20":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A20"},"A19":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A19"},"A18":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A18"},"A17":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A17"},"A16":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A16"},"A15":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A15"},"A14":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A14"},"A13":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A13"},"A12":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A12"},"A11":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A11"},"A10":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A10"},"A9":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A9"},"A8":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A8"},"A7":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A7"},"A6":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A6"},"A5":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A5"},"A4":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A4"},"A3":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A3"},"A2":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A2"},"A1":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"A1"},"SYSID":{"type":"integer","title":"Sysid"}},"type":"object","required":["SYSID"],"title":"VehiculosModelosResponse","description":"Schema for VehiculosModelos response"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file diff --git a/backend/api/v1/modules/sitar/prosec/schemas.py b/backend/api/v1/modules/sitar/prosec/schemas.py index 0e798b99..ee69df2f 100644 --- a/backend/api/v1/modules/sitar/prosec/schemas.py +++ b/backend/api/v1/modules/sitar/prosec/schemas.py @@ -1,19 +1,20 @@ -"""PROSEC Schemas""" +"""PROSEC Schemas — aligned with SITAR OpenAPI ProsecResponse.""" from typing import Optional from pydantic import BaseModel, ConfigDict, Field class ProsecResponse(BaseModel): - """PROSEC (Programa de Promoción Sectorial)""" + """PROSEC (Programa de Promoción Sectorial).""" - FRACCION: Optional[str] = Field(None, max_length=10) - PRODUCTO: Optional[str] = Field(None, max_length=999) - TASA: Optional[str] = Field(None, max_length=19) - SECTOR: Optional[str] = Field(None, max_length=2) - ANEXO: Optional[str] = Field(None, max_length=19) - DOF: Optional[str] = Field(None, max_length=8) - NOTAS: Optional[str] = Field(None, max_length=5000) + FRACCION: Optional[str] = Field("", max_length=10) + ARTICULO: Optional[str] = Field("", max_length=3) + SECTOR: Optional[str] = Field("", max_length=6) + TASATXT: Optional[str] = Field("", max_length=19) + TASANUM: Optional[str] = Field(default="0") + TIPOTASA: Optional[int] = Field(default=0) + DOF: Optional[str] = Field("", max_length=8) + OBSERVACION: Optional[str] = "" NICO: Optional[str] = Field("", max_length=2) SYSID: int diff --git a/backend/api/v1/modules/sitar/tlcs/schemas.py b/backend/api/v1/modules/sitar/tlcs/schemas.py index 86a462ed..281bbc48 100644 --- a/backend/api/v1/modules/sitar/tlcs/schemas.py +++ b/backend/api/v1/modules/sitar/tlcs/schemas.py @@ -1,21 +1,23 @@ -"""TLCS Schemas""" +"""TLCS Schemas — aligned with SITAR OpenAPI TLCSResponse.""" from typing import Optional from pydantic import BaseModel, ConfigDict, Field class TLCSResponse(BaseModel): - """TLCS (Tratados de Libre Comercio) response model""" + """TLCS (Tratados de Libre Comercio) response model.""" - FRACCION: Optional[str] = Field(None, max_length=8) - PAIS: Optional[str] = Field(None, max_length=3) - TASATXT: Optional[str] = Field(None, max_length=19) - TASANUM: Optional[str] = None - TASACALCULADA: Optional[str] = Field(None, max_length=19) - TLC: Optional[str] = Field(None, max_length=6) - NOTA: Optional[str] = None + FRACCION: str = Field(max_length=10) + PAIS: str = Field(max_length=3) + ORDEN: Optional[int] = None + TASATXT: Optional[str] = Field(None, max_length=44) + TIPOTASA: Optional[int] = None + TASA1NUM: Optional[str] = None + FACTOR1: Optional[str] = None + TASA2NUM: Optional[str] = None + FACTOR2: Optional[str] = None DOF: Optional[str] = Field(None, max_length=8) - OBSERVACION: Optional[str] = None + NOTAS: Optional[str] = Field(None, max_length=999) NICO: Optional[str] = Field("", max_length=2) SYSID: int diff --git a/backend/core/celery_app.py b/backend/core/celery_app.py index f9379f5a..24c21b6d 100644 --- a/backend/core/celery_app.py +++ b/backend/core/celery_app.py @@ -2,7 +2,7 @@ import os from celery import Celery from celery.signals import task_postrun, task_prerun -from core.database import rls_company_var, rls_tenant_var +from core.database import reset_rls_context_tokens, rls_company_var, rls_tenant_var valkey_url = os.getenv("VALKEY_URL", "redis://valkey:6379/0") @@ -60,14 +60,8 @@ def _reset_rls_context_from_task(task_id=None, task=None, **_): if tokens is None: return token_t, token_c = tokens - try: - rls_tenant_var.reset(token_t) - rls_company_var.reset(token_c) - except ValueError: - rls_tenant_var.set(None) - rls_company_var.set(None) - finally: - delattr(task, _RLS_TOKENS_ATTR) + reset_rls_context_tokens(token_t, token_c) + delattr(task, _RLS_TOKENS_ATTR) # ---------------------------------------------------------------------------- # Import models in correct order for SQLAlchemy relationship resolution diff --git a/backend/core/database.py b/backend/core/database.py index 95e937d3..f794f11a 100644 --- a/backend/core/database.py +++ b/backend/core/database.py @@ -114,6 +114,23 @@ def set_rls_context( _apply_rls_context(session.connection(), tenant_id, company_id) +def reset_rls_context_tokens(token_t, token_c) -> None: + """Restaura ContextVars de RLS de forma segura entre hilos/tareas asyncio. + + ``ContextVar.reset`` exige que el token se cree y restaure en el mismo contexto + lógico; en rutas FastAPI async + dependencias síncronas con ``yield`` (thread + pool) el ``finally`` puede ejecutarse en otro contexto y lanzar ``ValueError`` + (mensaje: "was created in a different Context"). En ese caso degradamos a + ``set(None)``, igual que ``task_postrun`` en ``core/celery_app.py``. + """ + try: + rls_tenant_var.reset(token_t) + rls_company_var.reset(token_c) + except (ValueError, RuntimeError): + rls_tenant_var.set(None) + rls_company_var.set(None) + + def _extract_rls_context(request: Optional[Request]) -> tuple[Optional[int], Optional[int]]: """Recupera ``tenant_id`` / ``company_id`` del estado del request (o de cookies).""" if request is None: @@ -150,8 +167,7 @@ def get_core_db(request: Request = None) -> Generator[Session, None, None]: yield db finally: db.close() - rls_tenant_var.reset(token_t) - rls_company_var.reset(token_c) + reset_rls_context_tokens(token_t, token_c) async def get_async_core_db(request: Request = None) -> AsyncGenerator[AsyncSession, None]: @@ -168,8 +184,7 @@ async def get_async_core_db(request: Request = None) -> AsyncGenerator[AsyncSess finally: await session.close() finally: - rls_tenant_var.reset(token_t) - rls_company_var.reset(token_c) + reset_rls_context_tokens(token_t, token_c) @contextmanager diff --git a/backend/core/middleware.py b/backend/core/middleware.py index 654feadf..f6150a23 100644 --- a/backend/core/middleware.py +++ b/backend/core/middleware.py @@ -159,118 +159,14 @@ class LicenseValidationMiddleware(BaseHTTPMiddleware): hub_headers["X-Tenant-Override"] = str(tenant_override) logger.info("[license] tenant override propagated to Hub: %s", tenant_override) + # Solo la petición HTTP al Hub va en try: los errores de rutas (p. ej. ContextVar RLS) + # deben propagarse y no etiquetarse como fallo de licencia. try: - # Validación contra el Hub Central async with httpx.AsyncClient(timeout=5.0) as client: response = await client.get( f"{settings.HUB_URL}api/v1/auth/verify-license", headers=hub_headers ) - - logger.info(f"🔑 verify-license → status={response.status_code} body={response.text[:300]}") - - if response.status_code == 404: - # Endpoint no existe en este Hub — dejar pasar - return await call_next(request) - - if response.status_code == 200: - data = response.json() - - # Escenario 1: sin licencia asignada o licencia inactiva - if not data.get("valid", False): - message = data.get("message", "Sin licencia asignada para este tenant") - detail = data.get("detail") - reason = data.get("reason") - # Si el Hub reporta token inválido/expirado, devolver 401 para que - # el frontend dispare el auto-refresh (solo se activa con 401/403, no 402). - if _is_token_issue_message(message, detail, reason): - logger.warning( - "[license] token expirado/invalido detectado por verify-license; devolviendo 401 para silent refresh | message=%s detail=%s reason=%s", - message, - detail, - reason, - ) - return JSONResponse( - status_code=401, - content={ - "error": "TOKEN_EXPIRED", - "message": message, - "status_code": 401, - } - ) - - logger.warning( - "[license] licencia invalida para tenant=%s | message=%s", - data.get("tenant_slug"), - message, - ) - return JSONResponse( - status_code=402, - content={ - "error": "LICENSE_ERROR", - "message": message, - "status_code": 402, - } - ) - - # Escenario 2: licencia vencida (verificación local de expires_at) - expires_at_str = data.get("expires_at") - if expires_at_str: - try: - expires_at = datetime.fromisoformat(expires_at_str.replace("Z", "+00:00")) - if expires_at.tzinfo is None: - expires_at = expires_at.replace(tzinfo=timezone.utc) - if expires_at < datetime.now(timezone.utc): - logger.warning( - "[license] licencia expirada para tenant=%s | expires_at=%s", - data.get("tenant_slug"), - expires_at_str, - ) - return JSONResponse( - status_code=402, - content={ - "error": "LICENSE_EXPIRED", - "message": f"La licencia venció el {expires_at.strftime('%d/%m/%Y')}. Renueva tu suscripción.", - "status_code": 402, - } - ) - except (ValueError, TypeError): - pass # Si no se puede parsear, dejamos pasar — el Hub es la fuente de verdad - - request.state.license_info = data - return await call_next(request) # <--- Único camino al éxito - - elif response.status_code == 401: - logger.warning("[license] Hub verify-license devolvio 401 (token invalido/expirado)") - return JSONResponse( - status_code=401, - content={ - "error": "TOKEN_EXPIRED", - "message": "Token inválido o expirado.", - "status_code": 401, - } - ) - - elif response.status_code == 403: - return JSONResponse( - status_code=403, - content={ - "error": "FORBIDDEN", - "message": "El Tenant no tiene permisos en el Hub central.", - "status_code": 403, - } - ) - else: - logger.error(f"Hub error status: {response.status_code}") - return JSONResponse( - status_code=503, - content={ - "error": "HUB_ERROR", - "message": "Error en el servidor de licencias.", - "status_code": 503, - } - ) - except (httpx.ConnectError, httpx.TimeoutException) as e: logger.critical(f"❌ CRITICAL: Hub unreachable: {str(e)}") return JSONResponse( @@ -282,12 +178,131 @@ class LicenseValidationMiddleware(BaseHTTPMiddleware): } ) except Exception as e: - logger.error(f"Unexpected license error: {str(e)}") + logger.error(f"Hub verify-license request failed: {str(e)}") return JSONResponse( status_code=500, - content={"error": "VALIDATION_ERROR", "message": "Error interno de validación.", "status_code": 500} + content={ + "error": "VALIDATION_ERROR", + "message": "Error interno al validar licencia con el Hub.", + "status_code": 500, + } ) + logger.info(f"🔑 verify-license → status={response.status_code} body={response.text[:300]}") + + if response.status_code == 404: + # Endpoint no existe en este Hub — dejar pasar + return await call_next(request) + + if response.status_code == 200: + try: + data = response.json() + except Exception as e: + logger.error(f"Hub verify-license JSON parse failed: {str(e)}") + return JSONResponse( + status_code=503, + content={ + "error": "HUB_ERROR", + "message": "Respuesta inválida del servidor de licencias.", + "status_code": 503, + } + ) + + # Escenario 1: sin licencia asignada o licencia inactiva + if not data.get("valid", False): + message = data.get("message", "Sin licencia asignada para este tenant") + detail = data.get("detail") + reason = data.get("reason") + # Si el Hub reporta token inválido/expirado, devolver 401 para que + # el frontend dispare el auto-refresh (solo se activa con 401/403, no 402). + if _is_token_issue_message(message, detail, reason): + logger.warning( + "[license] token expirado/invalido detectado por verify-license; devolviendo 401 para silent refresh | message=%s detail=%s reason=%s", + message, + detail, + reason, + ) + return JSONResponse( + status_code=401, + content={ + "error": "TOKEN_EXPIRED", + "message": message, + "status_code": 401, + } + ) + + logger.warning( + "[license] licencia invalida para tenant=%s | message=%s", + data.get("tenant_slug"), + message, + ) + return JSONResponse( + status_code=402, + content={ + "error": "LICENSE_ERROR", + "message": message, + "status_code": 402, + } + ) + + # Escenario 2: licencia vencida (verificación local de expires_at) + expires_at_str = data.get("expires_at") + if expires_at_str: + try: + expires_at = datetime.fromisoformat(expires_at_str.replace("Z", "+00:00")) + if expires_at.tzinfo is None: + expires_at = expires_at.replace(tzinfo=timezone.utc) + if expires_at < datetime.now(timezone.utc): + logger.warning( + "[license] licencia expirada para tenant=%s | expires_at=%s", + data.get("tenant_slug"), + expires_at_str, + ) + return JSONResponse( + status_code=402, + content={ + "error": "LICENSE_EXPIRED", + "message": f"La licencia venció el {expires_at.strftime('%d/%m/%Y')}. Renueva tu suscripción.", + "status_code": 402, + } + ) + except (ValueError, TypeError): + pass # Si no se puede parsear, dejamos pasar — el Hub es la fuente de verdad + + request.state.license_info = data + return await call_next(request) + + if response.status_code == 401: + logger.warning("[license] Hub verify-license devolvio 401 (token invalido/expirado)") + return JSONResponse( + status_code=401, + content={ + "error": "TOKEN_EXPIRED", + "message": "Token inválido o expirado.", + "status_code": 401, + } + ) + + if response.status_code == 403: + return JSONResponse( + status_code=403, + content={ + "error": "FORBIDDEN", + "message": "El Tenant no tiene permisos en el Hub central.", + "status_code": 403, + } + ) + + logger.error(f"Hub error status: {response.status_code}") + return JSONResponse( + status_code=503, + content={ + "error": "HUB_ERROR", + "message": "Error en el servidor de licencias.", + "status_code": 503, + } + ) + class RequestLoggingMiddleware(BaseHTTPMiddleware): """ diff --git a/frontend/src/lib/api/dashboard/a76/sitar.ts b/frontend/src/lib/api/dashboard/a76/sitar.ts index 9692ab5a..a25dbcf0 100644 --- a/frontend/src/lib/api/dashboard/a76/sitar.ts +++ b/frontend/src/lib/api/dashboard/a76/sitar.ts @@ -1,41 +1,42 @@ import { api } from '$lib/api'; import type { ApiResponse } from '$lib/api'; +/** Matches SITAR OpenAPI TLCSResponse */ export interface SitarTLCS { - FRACCION: string; - PAIS: string; - TASATXT: string; - TASANUM?: string | null; - TLC: string; - NOTA: string | null; - DOF: string | null; - OBSERVACION?: string | null; - NICO?: string; - SYSID: number; + FRACCION: string; + PAIS: string; + TASATXT?: string | null; + TASA1NUM?: string | null; + TASA2NUM?: string | null; + DOF?: string | null; + NOTAS?: string | null; + NICO?: string; + SYSID: number; } +/** Matches SITAR OpenAPI ProsecResponse */ export interface SitarPROSEC { - FRACCION: string; - PRODUCTO: string; - TASA: string; - SECTOR: string; - ANEXO: string; - DOF: string; - NOTAS: string | null; - NICO?: string; - SYSID: number; + FRACCION?: string; + ARTICULO?: string; + SECTOR?: string; + TASATXT?: string; + TASANUM?: string | null; + DOF?: string | null; + OBSERVACION?: string | null; + NICO?: string; + SYSID: number; } export interface SitarALADI { - FRACCION: string; - ACUERDO: string; - PAIS: string; - TASATXT: string; - TASANUM?: string | null; - DOF: string; - NOTAS: string | null; - NICO?: string; - SYSID: number; + FRACCION: string; + ACUERDO: string; + PAIS: string; + TASATXT: string; + TASANUM?: string | null; + DOF: string; + NOTAS: string | null; + NICO?: string; + SYSID: number; } export async function getSitarTLCS(filters: { fraccion: string; nico?: string }): Promise> { diff --git a/frontend/src/lib/components/dashboard/goods/fractions/SitarFractionTabs.svelte b/frontend/src/lib/components/dashboard/goods/fractions/SitarFractionTabs.svelte index ef9b8327..a054deab 100644 --- a/frontend/src/lib/components/dashboard/goods/fractions/SitarFractionTabs.svelte +++ b/frontend/src/lib/components/dashboard/goods/fractions/SitarFractionTabs.svelte @@ -272,7 +272,7 @@ {item.PAIS} {item.TASATXT} {item.DOF || '-'} - {item.NOTA || '-'} + {item.NOTAS || '-'} {:else} No hay información de TLCS disponible para esta fracción. @@ -303,9 +303,9 @@ {#each sitarPROSECData as item} - {item.PRODUCTO} + {item.ARTICULO} {item.SECTOR} - {item.TASA} + {item.TASATXT} {item.DOF || '-'} {:else} diff --git a/frontend/src/lib/components/dashboard/goods/parts/partForm.svelte b/frontend/src/lib/components/dashboard/goods/parts/partForm.svelte index a9ce69ac..3deb0c4a 100644 --- a/frontend/src/lib/components/dashboard/goods/parts/partForm.svelte +++ b/frontend/src/lib/components/dashboard/goods/parts/partForm.svelte @@ -3620,9 +3620,9 @@ {item.DOF || '-'} - {item.NOTA || '-'} + {item.NOTAS || '-'} {:else} @@ -3676,14 +3676,14 @@ {item.PRODUCTO}{item.ARTICULO} {item.SECTOR} {item.TASA}{item.TASATXT} {item.DOF || '-'}