Add TopSapp preliminary support
Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
d4c37a3f78
commit
723ad8c268
10 files changed
+11952
-2
No files matched your search
+84
-1
@@ -17,11 +17,24 @@ class NLPProcessor {
|
||||
'ping': ['ping', 'testar', 'test', 'conectividade'],
|
||||
'admin': ['admin', 'administração', 'administracao', 'painel'],
|
||||
'usuarios_autorizados': ['usuarios autorizados', 'users autorizados', 'lista usuarios', 'listar usuarios autorizados'],
|
||||
'meu_id': ['meu id', 'meu user id', 'my id', 'user id', 'minha id']
|
||||
'meu_id': ['meu id', 'meu user id', 'my id', 'user id', 'minha id'],
|
||||
'buscar_cliente': ['buscar cliente', 'procurar cliente', 'encontrar cliente', 'search cliente', 'cliente'],
|
||||
'ver_faturas': ['ver faturas', 'ver fatura', 'faturas', 'fatura', 'boletos', 'boleto', 'contas'],
|
||||
'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']
|
||||
};
|
||||
|
||||
// Padrões de comandos
|
||||
this.commandPatterns = [
|
||||
// Padrões específicos para TopSapp
|
||||
/^(buscar|procurar|encontrar)\s+(cliente|user)\s+(.+)$/i,
|
||||
/^(ver|mostrar)\s+(faturas?|boletos?|contas?)\s+(.+)$/i,
|
||||
/^(gerar|criar|imprimir)\s+(boleto|pdf)\s+(.+)$/i,
|
||||
/^(bloquear|suspender|cortar)\s+(cliente|user)\s+(.+)$/i,
|
||||
/^(liberar|desbloquear|reconectar)\s+(cliente|user)\s+(.+)$/i,
|
||||
/^(status|verificar)\s+(topsapp)$/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,
|
||||
@@ -120,6 +133,76 @@ class NLPProcessor {
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - buscar cliente
|
||||
if (/buscar|procurar|encontrar/i.test(action) && /cliente|user/i.test(fullMatch)) {
|
||||
let query = match[3] || match[2]; // Nome/CPF do cliente
|
||||
|
||||
return {
|
||||
action: 'buscar_cliente',
|
||||
target: query ? query.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_search_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
|
||||
|
||||
return {
|
||||
action: 'ver_faturas',
|
||||
target: query ? query.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_faturas_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - gerar boleto
|
||||
if (/gerar|criar|imprimir/i.test(action) && /boleto|pdf/i.test(fullMatch)) {
|
||||
let faturaId = match[3] || match[2]; // ID da fatura
|
||||
|
||||
return {
|
||||
action: 'gerar_boleto',
|
||||
target: faturaId ? faturaId.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_boleto_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// Detectar comandos TopSapp - bloquear cliente
|
||||
if (/bloquear|suspender|cortar/i.test(action) && /cliente|user/i.test(fullMatch)) {
|
||||
let clienteId = match[3] || match[2]; // ID do cliente
|
||||
|
||||
return {
|
||||
action: 'bloquear_cliente',
|
||||
target: clienteId ? clienteId.trim() : null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_block_pattern'
|
||||
};
|
||||
}
|
||||
|
||||
// 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 {
|
||||
action: 'status_topsapp',
|
||||
target: null,
|
||||
confidence: 0.95,
|
||||
type: 'topsapp_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