38 Commits
Author SHA1 Message Date
LizandroandClaude Sonnet 4.6 3ee850776b fix: UNIQUE en pagos_confirmados.email_hash previene doble crédito por race condition
Sin este índice, dos procesos PHP simultáneos podían pasar el check yaUsado()
ambos con false y marcar el mismo hash dos veces, aplicando la recarga doble.
Con UNIQUE, el segundo INSERT falla y el catch existente lo bloquea (falla cerrado).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-19 15:45:15 +00:00
LizandroandClaude Sonnet 4.6 bb311e7dcd feat: validación exacta de hora + remitente obligatorio + nombres guardados
- Hora exacta: tolerancia 0 (timestamp comprobante = timestamp email)
- Remitente bloquea: si el email trae el nombre del remitente y no coincide, rechaza
- Nuevo paso antes de mostrar datos bancarios: bot pide nombre completo del titular
- Nombres aceptados se guardan en solicitudes_recarga.nombre_remitente
- Próxima recarga: muestra botones con nombres anteriores confirmados o ingresa uno nuevo
- Funciona igual en Telegram y web chat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-19 15:27:31 +00:00
LizandroandClaude Sonnet 4.6 a7d7c32350 feat: sistema de solicitud de recarga con auto-aplicación y botón Reintentar
- SolicitudRecarga: modelo + migración para atar cada intento de recarga al usuario (previene cruce de pagos entre usuarios)
- PublicChat: mostrarTransferencia crea solicitud, updatedFotoComprobante valida contra ella, auto-aplica sin botón extra
- Botón Reintentar en web chat cuando el correo aún no llega (pago_pendiente en flujoData)
- aplicarRecargaValidada corregido: error de sintaxis por fragmento duplicado eliminado

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-19 14:40:52 +00:00
LizandroandClaude Sonnet 4.6 ba4ec8b6cf Prevent double-confirmation of same payment by different users
- Create pagos_confirmados table to track consumed email receipts
- PagoValidadorService now validates: valor + fecha + hora (±10min) + llave Bancolombia
- Each matched email is hashed (sha1 body+date) and marked as used; a second
  match returns estado=ya_usado instead of confirmado
- Add partial remitente name matching against the registered user's name
- GeminiVisionService prompt now extracts llave (@xxx) from the receipt image
- TelegramBotService shows distinct message for ya_usado state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-18 03:30:20 +00:00
LizandroandClaude Sonnet 4.6 44297aa0bb Add AI usage logs for Gemini and Whisper
- Migration + AiUsageLog model with tokens, duration, time, cost fields
- GeminiIntentService and GeminiVisionService log every API call
  with input/output token counts from usageMetadata and response time
- TelegramBotService logs Whisper calls with audio duration (from Telegram)
  and calculates cost at $1/second
- Whisper voice duration now passed from TelegramWebhookController
- Free text in Telegram now tries Gemini intent detection before showing menu
- /chat/ia-logs: Livewire component with summary cards + filterable table
- Whisper connection test button in config panel
- "Logs IA" link added to Chat/Bot nav section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:13:59 +00:00
LizandroandClaude Sonnet 4.6 536377363c feat: web chat con IA, validación de pagos y OTP por correo
- Chat público en /chat con flujos de compra, recarga y credenciales
- Verificación de identidad por código OTP enviado al correo registrado
- Botones enriquecidos: cards, links, credenciales, validación de comprobante
- Gemini IA para detección de intención en texto libre
- Gemini Vision para extraer datos de foto de comprobante
- Validador de pagos cruzando IA con correos IMAP (Bancolombia)
- MercadoPago como pasarela de pago (reemplaza Wompi en el chat)
- Migraciones: payload en chat_messages, user_id en chat_contacts
- Config admin: API key Gemini, toggles IA y validación de foto

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 00:09:31 +00:00
Lizandro Guarnizo f12e78d5a0 Update 2026_06_18_000002_create_compatibilidad_dgos_table.php 2026-06-18 12:21:45 -05:00
Lizandro Guarnizo 0282645c08 nuevo formulario 2026-06-18 11:06:49 -05:00
Lizandro Guarnizo 67732fbde5 up 2026-05-12 19:50:28 -05:00
Lizandro Guarnizo f61e8005fc chatbot nuevo 2026-04-30 21:32:32 -05:00
Lizandro Guarnizo 0e5ff957eb up 2026-04-25 15:04:50 -05:00
Lizandro Guarnizo bbf34d08d0 correo 2026-04-25 14:47:20 -05:00
Lizandro Guarnizo 148fa6b9f9 up 2026-04-24 21:40:10 -05:00
Juan Felipe Duarte 4a44dbc1c1 Implement device and IP tracking for users
Added Device and UserIp models and migrations to store device fingerprints and user IPs with expiration. Updated ShowSavingIp Livewire component and view to capture and persist both IP and device fingerprint. Introduced a scheduled command to clean expired user IPs and registered it in the console kernel. Removed the old migration for storing IPs directly on the users table.
2025-10-25 09:18:56 -05:00
Juan Felipe Duarte a558e393f2 Add rank management feature with CRUD and UI
Introduces a new rank management system including the Rank model, migrations for the ranks table and user IP address, Livewire components for managing and displaying ranks, and related Blade views. Updates navigation and routes to include the new 'Gestión Rangos' section, and enhances the ShareCodeComponent with user data. Also adds a reusable input field component for forms.
2025-10-23 20:28:47 -05:00
Juan Felipe Duarte 5c04a95792 update codigo referido funcionamiento login, register y dashboard 2025-10-15 16:43:43 -05:00
Juan Felipe Duarte a5aafd738d update global subvendedor 2025-08-22 10:09:23 -07:00
Juan Felipe Duarte 85d18dc4ff Tarifas y promos por usuario (falta el editar en la vista de tarifas)
Introduces the subvendedor_id field to the tarifa_promos table and updates the TarifaPromo model accordingly. Refactors tarifas and promociones management in ShowTarifas and ShowUsuarios Livewire components, including utility calculation, validation, and UI improvements for managing both regular and promo tarifas.
2025-06-25 16:36:32 -07:00
Juan Felipe Duarte 6eb6e3bd2f antes de comenzar la vista tarifas 2025-06-16 16:30:10 -07:00
Juan Felipe Duarte 6789ce3fb3 update 2025-06-14 09:03:54 -07:00
Lizandro Guarnizo d1c5dbc90e update 2025-04-14 18:08:49 -05:00
lizandrogd 7fcca03e4e telescope 2025-03-21 20:58:28 -05:00
lizandrogd c0e3284c62 historial_id 2025-02-27 15:19:52 -05:00
lizandrogd 76bd9df10e Se agrego tipo a log_general. 2025-02-27 10:55:12 -05:00
Felipe 374f3cbb69 catalogo 2024-04-27 16:52:31 -05:00
Felipe cd68c1d966 premios fixed 2024-03-07 10:55:42 -05:00
Felipe 3d1eac3801 reclamar premio 2024-03-06 12:03:57 -05:00
Felipe eb2e3ce76c editar tarifas promociones 2024-03-01 17:35:41 -05:00
Felipe accc509652 porfavor hacer la migracion 2024-03-01 10:46:35 -05:00
root 4506a003e8 Mensaje de commit 2023-11-07 22:43:10 +00:00
Felipe 1d3fac965d notificaciones migracion y maquetado y modelo 2023-10-23 10:29:15 -05:00
Felipe c7ba02a974 nueva tabla pendientes 2023-10-17 15:38:54 -05:00
Felipe d21d256551 log 2023-10-09 17:23:56 -05:00
Felipe 8dc97fb2df Asignar campo utilidad 2023-10-09 14:56:06 -05:00
Felipe c262916aae valor de compra 2023-10-09 10:29:05 -05:00
Felipe 41605dd83f log general 2023-10-07 17:31:35 -05:00
lizandrogd c100a2acd6 update 2023-07-26 11:22:26 -05:00
lizandrogd 8ce210f27c Initial commit 2023-07-26 08:28:13 -05:00