Merge pull request #184 from Kitzanos/feature/GEPAFINBE-152

GEPAFINBE-152 (Evaluation expiration issue)
This commit is contained in:
Rinaldo
2025-01-29 10:06:31 +01:00
committed by GitHub
4 changed files with 18 additions and 4 deletions

View File

@@ -208,6 +208,20 @@ public class NotificationDao {
}
}
public void sendNotificationToInstructorManager(Map<String, String> placeHolders, ApplicationEvaluationEntity applicationEvaluationEntity, NotificationTypeEnum notificationTypeEnum) {
List<UserEntity> userEntities=userRepository.findByRoleEntity_RoleTypeAndHubId(RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue(),applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication().getHubId());
for (UserEntity user:userEntities) {
Long instructorId=user.getId();
ApplicationEntity application = applicationService.validateApplication(applicationEvaluationEntity.getApplicationId());
if (instructorId != null) {
NotificationReq notificationreq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, instructorId, application.getUserWithCompany(),
null);
sendNotification(notificationreq);
}
}
}
public List<Long> getAllCompanyIdsForUser(Long userId) {
return userWithCompanyRepository.findActiveCompanyIdsByUserId(userId);