implementacao de logs de auditoria e alterar multiplos registros de competencia

This commit is contained in:
Vitex Tecnologia
2026-06-01 17:19:00 -03:00
parent 34ae317fed
commit 8a77c0dd31
5 changed files with 253 additions and 44 deletions
+21
View File
@@ -392,6 +392,27 @@ class FechamentoFechamentosService {
this.handleAxiosError(error, "Erro ao alterar competência da tarefa.");
}
}
async alterarCompetenciaTarefasEmLote(
fechamentoId: string,
input: { tarefaIds: string[]; competenciaDestinoId: string; alteradoPorId: string; motivo?: string },
): Promise<{ alteradas: number; tarefas: FechamentoTarefaItem[] }> {
try {
const headers = await buildCommanderHeaders();
const baseUrl = resolveCommanderBaseUrl();
const response = await axios.post<{
data: { alteradas: number; tarefas: FechamentoTarefaItem[] };
}>(`${baseUrl}/fechamentos/${fechamentoId}/tarefas/alterar-competencia`, {
tarefa_ids: input.tarefaIds,
competencia_destino_id: input.competenciaDestinoId,
alterado_por_id: input.alteradoPorId,
...(input.motivo?.trim() ? { motivo: input.motivo.trim() } : {}),
}, { headers });
return response.data.data;
} catch (error) {
this.handleAxiosError(error, "Erro ao alterar competência das tarefas.");
}
}
}
export const fechamentoFechamentosService = new FechamentoFechamentosService();