Commit Graph

5 Commits

Author SHA1 Message Date
minguezsanzjuanjose
d2c91d5196 feat: add Request_API dispatcher and internal API URLs
Replaces urllib http_client with proper Request_API class in general/request_api.py
using the requests library. Adds API_BACKOFFICE, API_COMUNICACIONES, API_DOCUMENTACION
settings pointing to Docker service names. Adds requests==2.32.3 to requirements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 02:24:46 +02:00
juanjo
0fc5392bd2 fix engram rtk
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-16 18:24:13 +02:00
juanjo
a8dbb62b09 fix: serializar dates/Decimal en LogService con DjangoJSONEncoder
Some checks are pending
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
DEPLOY_MULTI_BRACH/pipeline/pr-dev Build queued...
- Añadir _json_safe() que usa DjangoJSONEncoder para convertir objetos
  no serializables (datetime.date, Decimal, UUID...) antes de guardar
  en JSONField, evitando que response quede vacío silenciosamente
- Corregir condición status_code: usar 'is not None' para permitir status=0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 17:28:48 +02:00
juanjo
e908125d31 fix: corregir ruta de data/ y hacer LogService resiliente a fallos de BD
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
- Mover data/.gitkeep a app/data/.gitkeep (Django busca app/data/db.sqlite3,
  no data/db.sqlite3 en la raíz del repo, porque BASE_DIR apunta a app/)
- Actualizar .gitignore para ignorar también app/data/*
- LogService.gestionar_log ahora captura excepciones internamente para que
  un fallo de BD no rompa la petición (log omitido con WARNING, no 500)
- Mover import de Log dentro del método para evitar problemas de arranque

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 17:07:23 +02:00
juanjo
2f6564d9a6 feat: añadir app general con LogService centralizado
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/pr-dev This commit looks good
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
- Crear app/general con estructura estándar del proyecto:
  · utilidades/acciones.py → LogService.gestionar_log() (única fuente de logs)
  · utilidades/utils.py → get_client_ip()
  · utilidades/custom_errors.py → ValidationError, ExternalServiceError, NotFoundError
  · exception.py, request.py, serializers.py, validaciones/
- Registrar 'general' en INSTALLED_APPS y añadir general/ a urls.py
- Refactorizar promociones/views.py para usar LogService en lugar de Log directo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 16:50:53 +02:00