feat: melhorias no vínculo de tickets e exportação
This commit is contained in:
parent
1b32638eb5
commit
9495b54a28
7 changed files with 226 additions and 16 deletions
|
|
@ -1777,7 +1777,15 @@ export const create = mutation({
|
|||
await ctx.db.insert("ticketEvents", {
|
||||
ticketId: id,
|
||||
type: "ASSIGNEE_CHANGED",
|
||||
payload: { assigneeId: initialAssigneeId, assigneeName: initialAssignee.name, actorId: args.actorId },
|
||||
payload: {
|
||||
assigneeId: initialAssigneeId,
|
||||
assigneeName: initialAssignee.name,
|
||||
actorId: args.actorId,
|
||||
actorName: actorUser.name,
|
||||
actorAvatar: actorUser.avatarUrl ?? undefined,
|
||||
previousAssigneeId: null,
|
||||
previousAssigneeName: "Não atribuído",
|
||||
},
|
||||
createdAt: now,
|
||||
})
|
||||
}
|
||||
|
|
@ -2336,6 +2344,8 @@ export const changeAssignee = mutation({
|
|||
assigneeId,
|
||||
assigneeName: assignee.name,
|
||||
actorId,
|
||||
actorName: viewerUser.name,
|
||||
actorAvatar: viewerUser.avatarUrl ?? undefined,
|
||||
previousAssigneeId: currentAssigneeId,
|
||||
previousAssigneeName,
|
||||
reason: normalizedReason.length > 0 ? normalizedReason : undefined,
|
||||
|
|
@ -3170,6 +3180,9 @@ export const startWork = mutation({
|
|||
}
|
||||
|
||||
let assigneePatched = false
|
||||
const previousAssigneeIdForStart = currentAssigneeId
|
||||
const previousAssigneeNameForStart =
|
||||
((ticketDoc.assigneeSnapshot as { name?: string } | null)?.name as string | undefined) ?? "Não atribuído"
|
||||
|
||||
if (!currentAssigneeId) {
|
||||
const assigneeSnapshot = {
|
||||
|
|
@ -3201,7 +3214,15 @@ export const startWork = mutation({
|
|||
await ctx.db.insert("ticketEvents", {
|
||||
ticketId,
|
||||
type: "ASSIGNEE_CHANGED",
|
||||
payload: { assigneeId: actorId, assigneeName: viewer.user.name, actorId },
|
||||
payload: {
|
||||
assigneeId: actorId,
|
||||
assigneeName: viewer.user.name,
|
||||
actorId,
|
||||
actorName: viewer.user.name,
|
||||
actorAvatar: viewer.user.avatarUrl ?? undefined,
|
||||
previousAssigneeId: previousAssigneeIdForStart,
|
||||
previousAssigneeName: previousAssigneeNameForStart,
|
||||
},
|
||||
createdAt: now,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue