feat: implement collaborator reactivation logic, add access denied handling, and improve metric filtering

This commit is contained in:
2026-07-19 18:56:39 -03:00
parent af6c87acb6
commit 74d6ee6706
27 changed files with 3148 additions and 37 deletions
+4 -2
View File
@@ -536,7 +536,8 @@ class CompaniesManager implements ICompaniesManager {
const employ = await EmployeesList.employees.findOne({
companyId: data.id,
userId: String(data.sessionUser),
});
removed: { $ne: true },
} as any);
if (!employ) {
throw new Error("El usuario no participa de la organización");
@@ -721,7 +722,8 @@ class CompaniesManager implements ICompaniesManager {
//Organizaciones en las que participa como colaborador.
const orgCollaborator = await EmployeesList.employees.find({
userId: data.sessionUser,
});
removed: { $ne: true },
} as any);
for (const item of orgCollaborator) {
if (item.companyId) {