feat: update collaborator invitation flow to handle existing users and pending invitations in StepEngine

This commit is contained in:
2026-07-20 14:46:14 -03:00
parent b01149a19e
commit a9afb13d15
4 changed files with 180 additions and 56 deletions
+5 -1
View File
@@ -167,7 +167,11 @@ class EmployeeManager implements IEmployeesManager {
}
if (employeeCheck) {
throw new Error("El usuario ya pertenece a la compañia");
if (!employeeCheck.guestOk) {
throw new Error("La invitación para este usuario ya está pendiente");
}
throw new Error("El usuario ya pertenece a la compañía");
}
const canAdd = await MetricsList.canAddEmployee(companyCheck.ownerId);