fix TopSapp
This commit is contained in:
1 parent
8dc6c594c9
commit
bae6adefcb
42 files changed
+43645
-105
No files matched your search
+47
-26
@@ -23,7 +23,11 @@ class NLPProcessor {
|
||||
'gerar_boleto': ['gerar boleto', 'boleto', 'criar boleto', 'pdf boleto', 'imprimir boleto'],
|
||||
'bloquear_cliente': ['bloquear cliente', 'bloquear', 'suspender cliente', 'cortar cliente'],
|
||||
'liberar_cliente': ['liberar cliente', 'liberar', 'desbloquear cliente', 'reconectar cliente'],
|
||||
'status_topsapp': ['status topsapp', 'verificar topsapp', 'topsapp status', 'topsapp']
|
||||
'status_topsapp': ['status topsapp', 'verificar topsapp', 'topsapp status', 'topsapp'],
|
||||
'status_onu': ['status onu', 'verificar onu', 'onu status', 'check onu', 'status ont', 'ont status'],
|
||||
'fiberhome_status': ['fiberhome status', 'status fiberhome', 'conexões fiberhome', 'fiberhome conexoes'],
|
||||
'dados_cliente': ['dados cliente', 'dados cadastrais', 'cadastro cliente', 'informações cliente', 'info cliente'],
|
||||
'listar_servicos': ['listar serviços', 'servicos cliente', 'planos cliente', 'contratos cliente', 'ver servicos']
|
||||
};
|
||||
|
||||
// Padrões de comandos
|
||||
@@ -35,6 +39,13 @@ class NLPProcessor {
|
||||
/^(bloquear|suspender|cortar)\s+(cliente|user)\s+(.+)$/i,
|
||||
/^(liberar|desbloquear|reconectar)\s+(cliente|user)\s+(.+)$/i,
|
||||
/^(status|verificar)\s+(topsapp)$/i,
|
||||
/^(dados|cadastro|informações|info)\s+(cliente|cadastrais?)\s+(.+)$/i,
|
||||
/^(listar|ver)\s+(serviços?|servicos|planos|contratos)\s+(.+)$/i,
|
||||
// Padrões específicos para Fiberhome
|
||||
/^(status|verificar|check)\s+(onu|ont)\s+([A-Z0-9]+)$/i,
|
||||
/^(onu|ont)\s+(status|verificar|check)\s+([A-Z0-9]+)$/i,
|
||||
/^(status|verificar|check)\s+(fiberhome)$/i,
|
||||
/^(fiberhome)\s+(status|conexões|conexoes)$/i,
|
||||
// Padrões específicos para ver sinal
|
||||
/^(ver|verificar|check)\s+(sinal|signal)\s+([A-Z0-9]+)$/i,
|
||||
/^(sinal|signal)\s+([A-Z0-9]+)$/i,
|
||||
@@ -145,6 +156,18 @@ class NLPProcessor {
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - dados cadastrais
|
||||
if (/dados|cadastro|informações|info/i.test(action) && /cliente|cadastrais?/i.test(fullMatch)) {
|
||||
let query = match[3] || match[2]; // Nome/CPF/ID do cliente
|
||||
|
||||
return {
|
||||
action: 'dados_cliente',
|
||||
target: query ? query.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_dados_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - ver faturas
|
||||
if (/ver|mostrar/i.test(action) && /faturas?|boletos?|contas?/i.test(fullMatch)) {
|
||||
let query = match[3] || match[2]; // ID/CPF do cliente
|
||||
@@ -181,20 +204,8 @@ class NLPProcessor {
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - listar serviços
|
||||
if (/listar|ver|mostrar/i.test(action) && /serviços?|produtos?|planos?/i.test(fullMatch)) {
|
||||
let clienteId = match[3] || match[2]; // ID/CPF/Nome do cliente
|
||||
|
||||
return {
|
||||
action: 'listar_servicos',
|
||||
target: clienteId ? clienteId.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_services_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - liberar cliente/serviço
|
||||
if (/liberar|ativar|religar|reconectar/i.test(action)) {
|
||||
if (/liberar|desbloquear|reconectar|ativar|religar/i.test(action)) {
|
||||
let clienteId = match[3] || match[2]; // ID/CPF/Nome do cliente
|
||||
|
||||
return {
|
||||
@@ -205,18 +216,6 @@ class NLPProcessor {
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - liberar cliente
|
||||
if (/liberar|desbloquear|reconectar/i.test(action) && /cliente|user/i.test(fullMatch)) {
|
||||
let clienteId = match[3] || match[2]; // ID do cliente
|
||||
|
||||
return {
|
||||
action: 'liberar_cliente',
|
||||
target: clienteId ? clienteId.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_unblock_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - status
|
||||
if (/status|verificar/i.test(action) && /topsapp/i.test(fullMatch)) {
|
||||
return {
|
||||
@@ -227,6 +226,28 @@ class NLPProcessor {
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos Fiberhome - status ONU
|
||||
if (/status|verificar|check/i.test(action) && /onu|ont/i.test(fullMatch)) {
|
||||
let serialNumber = match[3] || match[2]; // Capturar serial do terceiro ou segundo grupo
|
||||
|
||||
return {
|
||||
action: 'status_onu',
|
||||
target: serialNumber ? serialNumber.trim().toUpperCase() : null,
|
||||
confidence: 0.95,
|
||||
type: 'fiberhome_onu_status_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos Fiberhome - status geral
|
||||
if (/status|verificar|conexões|conexoes/i.test(action) && /fiberhome/i.test(fullMatch)) {
|
||||
return {
|
||||
action: 'fiberhome_status',
|
||||
target: null,
|
||||
confidence: 0.95,
|
||||
type: 'fiberhome_status_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Padrão específico para "sinal SERIAL"
|
||||
if (/sinal|signal/i.test(action)) {
|
||||
let serialNumber = match[2]; // Segundo grupo capturado
|
||||
|
||||
Reference in new issue
Block a user