FIX: Refatorar lógica de verificação de escopo em handleTicket para usar array de palavras-chave
This commit is contained in:
parent
809acae4b6
commit
2d1c8647da
@ -17,7 +17,16 @@ const e = require('express');
|
||||
|
||||
const handleTicket = async (glpiTicketId, ticketTitle) => {
|
||||
try {
|
||||
if (!tolow(ticketTitle).includes("mundiale") || !tolow(ticketTitle).includes("implantacao") || !tolow(ticketTitle).includes("sac") || !tolow(ticketTitle).includes('cancelamento') || !tolow(ticketTitle).includes('troca de titularidade')) {
|
||||
const keywords = [
|
||||
"mundiale", "implantacao", "implantação", "sac",
|
||||
"cancelamento", "troca de titularidade"
|
||||
];
|
||||
|
||||
const lowerCaseTitle = ticketTitle.toLowerCase();
|
||||
|
||||
const isInScope = keywords.some(keyword => lowerCaseTitle.includes(keyword));
|
||||
|
||||
if (!isInScope) {
|
||||
logInfo(`Ticket ID ${glpiTicketId} esta fora do escopo do fluxo. Ignorando fechamento.`);
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user