feat: export reports as xlsx and add machine inventory
This commit is contained in:
parent
29b865885c
commit
714b199879
34 changed files with 2304 additions and 245 deletions
|
|
@ -255,6 +255,8 @@ function buildTimelineMessage(type: string, payload: Record<string, unknown> | n
|
|||
const assignee = (p.assigneeName as string | undefined) ?? (p.assigneeId as string | undefined)
|
||||
const queue = (p.queueName as string | undefined) ?? (p.queueId as string | undefined)
|
||||
const requester = p.requesterName as string | undefined
|
||||
const requesterEmail = p.requesterEmail as string | undefined
|
||||
const requesterId = p.requesterId as string | undefined
|
||||
const author = (p.authorName as string | undefined) ?? (p.authorId as string | undefined)
|
||||
const actor = (p.actorName as string | undefined) ?? (p.actorId as string | undefined)
|
||||
const attachmentName = p.attachmentName as string | undefined
|
||||
|
|
@ -283,6 +285,21 @@ function buildTimelineMessage(type: string, payload: Record<string, unknown> | n
|
|||
const who = actor ?? author
|
||||
return who ? `Comentário editado por ${who}` : "Comentário editado"
|
||||
}
|
||||
case "REQUESTER_CHANGED": {
|
||||
let display: string | null = null
|
||||
if (requester) {
|
||||
display = requesterEmail ? `${requester} (${requesterEmail})` : requester
|
||||
} else if (requesterEmail) {
|
||||
display = requesterEmail
|
||||
} else if (requesterId) {
|
||||
display = requesterId
|
||||
}
|
||||
const companyName = (p.companyName as string | undefined) ?? null
|
||||
if (display && companyName) return `Solicitante alterado para ${display} • Empresa: ${companyName}`
|
||||
if (display) return `Solicitante alterado para ${display}`
|
||||
if (companyName) return `Solicitante associado à empresa ${companyName}`
|
||||
return "Solicitante alterado"
|
||||
}
|
||||
case "SUBJECT_CHANGED":
|
||||
return subjectTo ? `Assunto alterado para "${subjectTo}"` : "Assunto alterado"
|
||||
case "SUMMARY_CHANGED":
|
||||
|
|
@ -389,6 +406,10 @@ function TicketPdfDocument({ ticket, logoDataUrl }: { ticket: TicketWithDetails;
|
|||
{ label: "Criado em", value: formatDateTime(ticket.createdAt) },
|
||||
{ label: "Atualizado em", value: formatDateTime(ticket.updatedAt) },
|
||||
]
|
||||
if (ticket.machine) {
|
||||
const machineLabel = ticket.machine.hostname ?? (ticket.machine.id ? `ID ${ticket.machine.id}` : "—")
|
||||
rightMeta.push({ label: "Máquina", value: machineLabel })
|
||||
}
|
||||
if (ticket.resolvedAt) {
|
||||
rightMeta.push({ label: "Resolvido em", value: formatDateTime(ticket.resolvedAt) })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue