diff --git a/src/services/ticketService.js b/src/services/ticketService.js index c2547ce..3d5fef4 100644 --- a/src/services/ticketService.js +++ b/src/services/ticketService.js @@ -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; }