From 8d4ba3ee88031fbe8dae628c8e74f0ec4b3b4a8b Mon Sep 17 00:00:00 2001 From: AI Bot Date: Mon, 7 Sep 2026 16:16:28 -0500 Subject: [PATCH] fix(notifications): dirigir todas las notificaciones de DripZone exclusivamente al WhatsApp personal de Carlos --- .../src/app/api/custom-requests/route.ts | 1 - dripzone-app/src/lib/evolution-api.ts | 18 +++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/dripzone-app/src/app/api/custom-requests/route.ts b/dripzone-app/src/app/api/custom-requests/route.ts index acdfcd9..21de77d 100644 --- a/dripzone-app/src/app/api/custom-requests/route.ts +++ b/dripzone-app/src/app/api/custom-requests/route.ts @@ -114,7 +114,6 @@ ${customerEmail ? `✉️ *Correo:* ${customerEmail}\n` : ''} ⚡ ¡Consulta de inmediato con tus proveedores mayoristas para enviar cotización al cliente!`; sendWhatsAppMessage(CARLOS_PHONE, adminMessage).catch(() => {}); - sendWhatsAppMessage('120363428012905103@g.us', adminMessage).catch(() => {}); // 2. Confirmación automática al cliente por WhatsApp usando la plantilla registrada const settings = dataService.getSettings(); diff --git a/dripzone-app/src/lib/evolution-api.ts b/dripzone-app/src/lib/evolution-api.ts index 3bbacb0..7ed8cd5 100644 --- a/dripzone-app/src/lib/evolution-api.ts +++ b/dripzone-app/src/lib/evolution-api.ts @@ -127,8 +127,7 @@ export async function sendWhatsAppMedia( /** * Notifica inmediatamente la publicación automática de un nuevo producto - * tanto al WhatsApp personal de Carlos (+57 316 745 5877) como al canal - * de Notificaciones Almeira (120363428012905103@g.us). + * exclusivamente al WhatsApp personal de Carlos (+57 316 745 5877). */ export async function notifyNewProductPublished( product: any, @@ -136,8 +135,7 @@ export async function notifyNewProductPublished( mediaUrl?: string ): Promise<{ success: boolean; dispatchedTo: string[] }> { const NOTIFICATION_TARGETS = [ - '573167455877', // Carlos (WhatsApp personal) - '120363428012905103@g.us', // Notificaciones Almeira + '573167455877', // Carlos (WhatsApp personal exclusivo) ]; const retailPrice = product.retailPrice || 125000; @@ -273,7 +271,6 @@ export function buildOrderConfirmationMessage(order: any): string { */ export async function notifyAdminNewOrder(order: any): Promise { const CARLOS_PHONE = '573167455877'; - const NOTIFICATION_GROUP = '120363428012905103@g.us'; const itemsSummary = (order.items || []) .map((item: any) => `• 👟 *${item.productName || item.name}*\n 📏 Talla: *${item.size || 'Única'}* | Cantidad: *${item.quantity || 1}* | Valor: *${formatCOP((item.price || item.retailPrice || 0) * (item.quantity || 1))}*`) @@ -326,7 +323,7 @@ export async function notifyAdminNewOrder(order: any): Promise { let success = false; try { - // 1. Notificación principal al WhatsApp personal de Carlos CON LA FOTO DEL PRODUCTO + // Notificación exclusiva al WhatsApp personal de Carlos CON LA FOTO DEL PRODUCTO let sentCarlos = false; if (resolvedImageUrl) { sentCarlos = await sendWhatsAppMedia(CARLOS_PHONE, resolvedImageUrl, adminMessage); @@ -335,15 +332,6 @@ export async function notifyAdminNewOrder(order: any): Promise { sentCarlos = await sendWhatsAppMessage(CARLOS_PHONE, adminMessage); } if (sentCarlos) success = true; - - // 2. Notificación al canal de alertas (grupo) CON LA FOTO DEL PRODUCTO - let sentGroup = false; - if (resolvedImageUrl) { - sentGroup = await sendWhatsAppMedia(NOTIFICATION_GROUP, resolvedImageUrl, adminMessage).catch(() => false); - } - if (!sentGroup) { - await sendWhatsAppMessage(NOTIFICATION_GROUP, adminMessage).catch(() => {}); - } } catch (err: any) { console.error('Error enviando notificación de pedido a Carlos:', err.message); }