The admin must be able to assign a submitted application to a pre-instructor user

This commit is contained in:
Anisha Gokhru
2024-10-21 18:46:58 +05:30
parent c0e1dee4c7
commit 3424921f3b
19 changed files with 561 additions and 10 deletions

View File

@@ -274,11 +274,11 @@ public class ApplicationDao {
// return applicationResponses;
// }
public List<ApplicationResponse> getAllApplications(UserEntity userEntity, Long callId, Long companyId) {
public List<ApplicationResponse> getAllApplications(UserEntity userEntity, Long callId, Long companyId,String status) {
log.info("Fetching applications for RoleType: {}", userEntity.getRoleEntity().getRoleType());
Specification<ApplicationEntity> spec = search(userEntity.getId(), callId, companyId);
Specification<ApplicationEntity> spec = search(userEntity.getId(), callId, companyId,status);
List<ApplicationEntity> applicationEntities = applicationRepository.findAll(spec);
@@ -288,7 +288,7 @@ public class ApplicationDao {
}
private Specification<ApplicationEntity> search(Long userId, Long callId, Long companyId) {
private Specification<ApplicationEntity> search(Long userId, Long callId, Long companyId,String status) {
return (root, query, builder) -> {
Boolean isBeneficiary = validator.checkIsBeneficiary();
Predicate predicate = builder.isFalse(root.get("isDeleted"));
@@ -301,6 +301,10 @@ public class ApplicationDao {
if (companyId != null) {
predicate = builder.and(predicate, builder.equal(root.get("company").get("id"), companyId));
}
if (status != null) {
predicate = builder.and(predicate, builder.equal(root.get("status"), status));
}
return predicate;
};
}