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
|
|
@ -199,6 +199,38 @@ describe("convex.tickets.resolveTicketHandler", () => {
|
|||
})
|
||||
)
|
||||
})
|
||||
|
||||
it("impede encerrar ticket quando há checklist obrigatório pendente", async () => {
|
||||
const ticketMain = buildTicket({
|
||||
checklist: [{ id: "c1", text: "Validar backup", done: false, required: true }] as unknown as TicketDoc["checklist"],
|
||||
})
|
||||
|
||||
const { ctx, patch } = createResolveCtx({
|
||||
[String(ticketMain._id)]: ticketMain,
|
||||
})
|
||||
|
||||
mockedRequireStaff.mockResolvedValue({
|
||||
user: {
|
||||
_id: "user_agent" as Id<"users">,
|
||||
_creationTime: NOW - 5_000,
|
||||
tenantId: "tenant-1",
|
||||
name: "Agente",
|
||||
email: "agente@example.com",
|
||||
role: "ADMIN",
|
||||
teams: [],
|
||||
},
|
||||
role: "ADMIN",
|
||||
})
|
||||
|
||||
await expect(
|
||||
resolveTicketHandler(ctx, {
|
||||
ticketId: ticketMain._id,
|
||||
actorId: "user_agent" as Id<"users">,
|
||||
})
|
||||
).rejects.toThrow("checklist")
|
||||
|
||||
expect(patch).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe("convex.tickets.reopenTicketHandler", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue