feat: checklists em tickets + automações
- Adiciona checklist no ticket (itens obrigatórios/opcionais) e bloqueia encerramento com pendências\n- Cria templates de checklist (globais/por empresa) + tela em /settings/checklists\n- Nova ação de automação: aplicar template de checklist\n- Corrige crash do Select (value vazio), warnings de Dialog e dimensionamento de charts\n- Ajusta SMTP (STARTTLS) e melhora teste de integração
This commit is contained in:
parent
4306b0504d
commit
88a9ef454e
27 changed files with 2685 additions and 226 deletions
|
|
@ -51,18 +51,34 @@ describe("sendSmtpMail - integracao", () => {
|
|||
// Para rodar: SMTP_INTEGRATION_TEST=true bun test tests/email-smtp.test.ts
|
||||
const { sendSmtpMail } = await import("@/server/email-smtp")
|
||||
|
||||
const host = process.env.SMTP_HOST
|
||||
const port = process.env.SMTP_PORT
|
||||
const username = process.env.SMTP_USER
|
||||
const password = process.env.SMTP_PASS
|
||||
const fromEmail = process.env.SMTP_FROM_EMAIL
|
||||
const fromName = process.env.SMTP_FROM_NAME ?? "Sistema de Chamados"
|
||||
|
||||
if (!host || !port || !username || !password || !fromEmail) {
|
||||
throw new Error(
|
||||
"Variáveis SMTP ausentes. Defina SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM_EMAIL (e opcionalmente SMTP_FROM_NAME, SMTP_SECURE, SMTP_TEST_TO)."
|
||||
)
|
||||
}
|
||||
|
||||
const config = {
|
||||
host: process.env.SMTP_HOST ?? "smtp.c.inova.com.br",
|
||||
port: Number(process.env.SMTP_PORT ?? 587),
|
||||
username: process.env.SMTP_USER ?? "envio@rever.com.br",
|
||||
password: process.env.SMTP_PASS ?? "CAAJQm6ZT6AUdhXRTDYu",
|
||||
from: process.env.SMTP_FROM_EMAIL ?? "Sistema de Chamados <envio@rever.com.br>",
|
||||
host,
|
||||
port: Number(port),
|
||||
username,
|
||||
password,
|
||||
from: `"${fromName}" <${fromEmail}>`,
|
||||
tls: (process.env.SMTP_SECURE ?? "false").toLowerCase() === "true",
|
||||
starttls: (process.env.SMTP_SECURE ?? "false").toLowerCase() !== "true",
|
||||
timeoutMs: 30000,
|
||||
}
|
||||
|
||||
// Enviar email de teste
|
||||
const to = process.env.SMTP_TEST_TO ?? fromEmail
|
||||
|
||||
await expect(
|
||||
sendSmtpMail(config, "envio@rever.com.br", "Teste automatico do sistema", "<p>Este e um teste automatico.</p>")
|
||||
sendSmtpMail(config, to, "Teste automático do sistema", "<p>Este é um teste automático.</p>")
|
||||
).resolves.toBeUndefined()
|
||||
})
|
||||
}, { timeout: 60000 })
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue