Allow reassigning during active sessions
This commit is contained in:
parent
feac6c2bb7
commit
c79ba4638c
1 changed files with 0 additions and 4 deletions
|
|
@ -2805,11 +2805,7 @@ export const changeAssignee = mutation({
|
|||
if (viewer.role === "MANAGER") {
|
||||
throw new ConvexError("Gestores não podem reatribuir chamados")
|
||||
}
|
||||
const normalizedStatus = normalizeStatus(ticketDoc.status)
|
||||
const hasActiveSession = Boolean(ticketDoc.activeSessionId)
|
||||
if (normalizedStatus === "AWAITING_ATTENDANCE" && !hasActiveSession) {
|
||||
throw new ConvexError("Pause o atendimento antes de reatribuir o chamado")
|
||||
}
|
||||
const currentAssigneeId = ticketDoc.assigneeId ?? null
|
||||
if (currentAssigneeId && currentAssigneeId !== actorId && !isAdmin) {
|
||||
throw new ConvexError("Somente o responsável atual pode reatribuir este chamado")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue