diff --git a/src/bot/handler.js b/src/bot/handler.js index de3a845..53a9e0d 100644 --- a/src/bot/handler.js +++ b/src/bot/handler.js @@ -3330,6 +3330,8 @@ Digite /help para ver todos os comandos disponíveis! oltId, oltHost: oltEquipment ? oltEquipment.host : '', serial: serialNumber, + onuId, + servicePort: result.servicePortId ? parseInt(result.servicePortId) : null, portaAlias: slot } }); @@ -6177,11 +6179,20 @@ Digite /help para ver todos os comandos disponíveis! const ftthData = { serial: onuData.serial, + ftth_serial: onuData.serial, + ftth_ipgerencia: onuData.oltHost, idAP: oltEncontrada.id, idPorta: portaEncontrada.id, idPerfil: perfilEncontrado.id }; + if (onuData.onuId !== undefined && onuData.onuId !== null) { + ftthData.ftth_onuid = parseInt(onuData.onuId); + } + if (onuData.servicePort !== null && onuData.servicePort !== undefined) { + ftthData.ftth_servport = onuData.servicePort; + } + // Salvar payload de confirmação na sessão const session = this.userSessions.get(userId); session.action = 'topsapp_onu_confirmando'; @@ -6193,11 +6204,17 @@ Digite /help para ver todos os comandos disponíveis! }; this.userSessions.set(userId, session); + const onuIdInfo = onuData.onuId !== undefined && onuData.onuId !== null + ? `\n🔢 *ONU ID:* ${onuData.onuId}` : ''; + const spInfo = onuData.servicePort !== null && onuData.servicePort !== undefined + ? `\n🔌 *Service-port:* ${onuData.servicePort}` : ''; + await this.bot.sendMessage(chatId, `🔌 *Confirmar Vinculação no TopSapp*\n\n` + `📱 *Serial:* \`${onuData.serial}\`\n` + `🏢 *OLT:* ${oltEncontrada.nome}\n` + - `📡 *Porta:* ${portaEncontrada.alias}\n` + + `📡 *Porta:* ${portaEncontrada.alias}` + + onuIdInfo + spInfo + `\n` + `⚙️ *Perfil:* ${perfilEncontrado.identificacao}\n` + `🆔 *Serviço ID:* ${idServico}\n` + `👤 *Cliente ID:* ${idCliente}\n\n` +