refactor: simplify ticket form and SLA configuration handling
- Removed SLA configuration selection from the TicketForm component to streamline the ticket creation process. - Updated the abrir-chamado route to eliminate unnecessary SLA loading logic and directly pass loading state to the TicketForm. - Enhanced the central-chamados route to support SLA configurations by priority, allowing for better management of SLA settings. - Introduced new mutations for SLA configuration management, including creation, updating, and deletion of SLA settings. - Improved email templates for ticket notifications, ensuring better communication with users regarding ticket status and updates.
This commit is contained in:
@@ -287,6 +287,115 @@ export const criarTemplatesPadrao = mutation({
|
||||
+ "</div></body></html>",
|
||||
variaveis: ["remetente", "mensagem", "conversaId", "urlSistema"],
|
||||
},
|
||||
{
|
||||
codigo: "chamado_registrado",
|
||||
nome: "Chamado Registrado",
|
||||
titulo: "Chamado {{numeroTicket}} registrado",
|
||||
corpo: "<html><body style='font-family: Arial, sans-serif; line-height: 1.6; color: #333;'>"
|
||||
+ "<div style='max-width: 600px; margin: 0 auto; padding: 20px;'>"
|
||||
+ "<h2 style='color: #2563EB;'>Chamado registrado com sucesso!</h2>"
|
||||
+ "<p>Olá <strong>{{solicitante}}</strong>,</p>"
|
||||
+ "<p>Recebemos sua solicitação e iniciaremos o atendimento em breve.</p>"
|
||||
+ "<div style='background-color: #EFF6FF; border-left: 4px solid #2563EB; padding: 15px; border-radius: 8px; margin: 20px 0;'>"
|
||||
+ "<p style='margin: 0;'><strong>Ticket:</strong> {{numeroTicket}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Prioridade:</strong> {{prioridade}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Categoria:</strong> {{categoria}}</p>"
|
||||
+ "</div>"
|
||||
+ "<p style='margin-top: 30px;'>"
|
||||
+ "<a href='{{urlSistema}}/perfil/chamados' "
|
||||
+ "style='background-color: #2563EB; color: white; padding: 12px 24px; "
|
||||
+ "text-decoration: none; border-radius: 6px; display: inline-block;'>"
|
||||
+ "Acompanhar chamado"
|
||||
+ "</a>"
|
||||
+ "</p>"
|
||||
+ "<p style='color: #6B7280; font-size: 12px; margin-top: 30px;'>"
|
||||
+ "Central de Chamados SGSE"
|
||||
+ "</p>"
|
||||
+ "</div></body></html>",
|
||||
variaveis: ["solicitante", "numeroTicket", "prioridade", "categoria", "urlSistema"],
|
||||
},
|
||||
{
|
||||
codigo: "chamado_atualizado",
|
||||
nome: "Atualização no Chamado",
|
||||
titulo: "Atualização no chamado {{numeroTicket}}",
|
||||
corpo: "<html><body style='font-family: Arial, sans-serif; line-height: 1.6; color: #333;'>"
|
||||
+ "<div style='max-width: 600px; margin: 0 auto; padding: 20px;'>"
|
||||
+ "<h2 style='color: #2563EB;'>Nova atualização no seu chamado</h2>"
|
||||
+ "<p>Olá <strong>{{solicitante}}</strong>,</p>"
|
||||
+ "<p>Há uma nova atualização no seu chamado:</p>"
|
||||
+ "<div style='background-color: #EFF6FF; border-left: 4px solid #2563EB; padding: 15px; border-radius: 8px; margin: 20px 0;'>"
|
||||
+ "<p style='margin: 0;'><strong>Ticket:</strong> {{numeroTicket}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Mensagem:</strong></p>"
|
||||
+ "<p style='margin: 10px 0 0 0;'>{{mensagem}}</p>"
|
||||
+ "</div>"
|
||||
+ "<p style='margin-top: 30px;'>"
|
||||
+ "<a href='{{urlSistema}}/perfil/chamados' "
|
||||
+ "style='background-color: #2563EB; color: white; padding: 12px 24px; "
|
||||
+ "text-decoration: none; border-radius: 6px; display: inline-block;'>"
|
||||
+ "Ver detalhes"
|
||||
+ "</a>"
|
||||
+ "</p>"
|
||||
+ "<p style='color: #6B7280; font-size: 12px; margin-top: 30px;'>"
|
||||
+ "Central de Chamados SGSE"
|
||||
+ "</p>"
|
||||
+ "</div></body></html>",
|
||||
variaveis: ["solicitante", "numeroTicket", "mensagem", "urlSistema"],
|
||||
},
|
||||
{
|
||||
codigo: "chamado_atribuido",
|
||||
nome: "Chamado Atribuído",
|
||||
titulo: "Chamado {{numeroTicket}} atribuído",
|
||||
corpo: "<html><body style='font-family: Arial, sans-serif; line-height: 1.6; color: #333;'>"
|
||||
+ "<div style='max-width: 600px; margin: 0 auto; padding: 20px;'>"
|
||||
+ "<h2 style='color: #059669;'>Chamado atribuído</h2>"
|
||||
+ "<p>Olá <strong>{{responsavel}}</strong>,</p>"
|
||||
+ "<p>Um novo chamado foi atribuído para você:</p>"
|
||||
+ "<div style='background-color: #ECFDF5; border-left: 4px solid #059669; padding: 15px; border-radius: 8px; margin: 20px 0;'>"
|
||||
+ "<p style='margin: 0;'><strong>Ticket:</strong> {{numeroTicket}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Solicitante:</strong> {{solicitante}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Prioridade:</strong> {{prioridade}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Descrição:</strong> {{descricao}}</p>"
|
||||
+ "</div>"
|
||||
+ "<p style='margin-top: 30px;'>"
|
||||
+ "<a href='{{urlSistema}}/ti/central-chamados' "
|
||||
+ "style='background-color: #059669; color: white; padding: 12px 24px; "
|
||||
+ "text-decoration: none; border-radius: 6px; display: inline-block;'>"
|
||||
+ "Acessar chamado"
|
||||
+ "</a>"
|
||||
+ "</p>"
|
||||
+ "<p style='color: #6B7280; font-size: 12px; margin-top: 30px;'>"
|
||||
+ "Central de Chamados SGSE"
|
||||
+ "</p>"
|
||||
+ "</div></body></html>",
|
||||
variaveis: ["responsavel", "numeroTicket", "solicitante", "prioridade", "descricao", "urlSistema"],
|
||||
},
|
||||
{
|
||||
codigo: "chamado_alerta_prazo",
|
||||
nome: "Alerta de Prazo do Chamado",
|
||||
titulo: "⚠️ Alerta de prazo - Chamado {{numeroTicket}}",
|
||||
corpo: "<html><body style='font-family: Arial, sans-serif; line-height: 1.6; color: #333;'>"
|
||||
+ "<div style='max-width: 600px; margin: 0 auto; padding: 20px;'>"
|
||||
+ "<h2 style='color: #DC2626;'>⚠️ Alerta de prazo</h2>"
|
||||
+ "<p>Olá <strong>{{destinatario}}</strong>,</p>"
|
||||
+ "<p>O chamado abaixo está próximo do prazo de {{tipoPrazo}}:</p>"
|
||||
+ "<div style='background-color: #FEF2F2; border-left: 4px solid #DC2626; padding: 15px; border-radius: 8px; margin: 20px 0;'>"
|
||||
+ "<p style='margin: 0;'><strong>Ticket:</strong> {{numeroTicket}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Prazo de {{tipoPrazo}}:</strong> {{prazo}}</p>"
|
||||
+ "<p style='margin: 5px 0 0 0;'><strong>Status:</strong> {{status}}</p>"
|
||||
+ "</div>"
|
||||
+ "<p style='margin-top: 30px;'>"
|
||||
+ "<a href='{{urlSistema}}{{rotaAcesso}}' "
|
||||
+ "style='background-color: #DC2626; color: white; padding: 12px 24px; "
|
||||
+ "text-decoration: none; border-radius: 6px; display: inline-block;'>"
|
||||
+ "Ver chamado"
|
||||
+ "</a>"
|
||||
+ "</p>"
|
||||
+ "<p style='color: #6B7280; font-size: 12px; margin-top: 30px;'>"
|
||||
+ "Central de Chamados SGSE"
|
||||
+ "</p>"
|
||||
+ "</div></body></html>",
|
||||
variaveis: ["destinatario", "numeroTicket", "tipoPrazo", "prazo", "status", "urlSistema", "rotaAcesso"],
|
||||
},
|
||||
];
|
||||
|
||||
for (const template of templatesPadrao) {
|
||||
|
||||
Reference in New Issue
Block a user