Commented check from already exists application

This commit is contained in:
nisha
2024-12-23 15:23:19 +05:30
parent c0dfbd2c5d
commit fb21bdb150

View File

@@ -804,18 +804,18 @@ public class ApplicationDao {
UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(userEntity.getId(),companyEntity.getId());
// call = callService.validatePublishedCall(call.getId());
checkIfApplicationExists(call, userWithCompanyEntity, userEntity);
// checkIfApplicationExists(call, userWithCompanyEntity, userEntity);
ApplicationEntity applicationEntity = createApplicationEntity(userEntity, call, userWithCompanyEntity);
applicationEntity.setComments(applicationRequest.getComments());
applicationEntity = saveApplicationEntity(applicationEntity);
return getApplicationResponse(applicationEntity);
}
public void checkIfApplicationExists(CallEntity call, UserWithCompanyEntity userWithCompanyEntity, UserEntity userEntity){
Optional<ApplicationEntity> applicationEntity=applicationRepository.findByUserIdAndUserWithCompanyIdAndCallIdAndIsDeletedFalse(userEntity.getId(), userWithCompanyEntity.getId(),call.getId());
if(applicationEntity.isPresent()){
throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_ALREADY_EXISTS));
}
}
// public void checkIfApplicationExists(CallEntity call, UserWithCompanyEntity userWithCompanyEntity, UserEntity userEntity){
// Optional<ApplicationEntity> applicationEntity=applicationRepository.findByUserIdAndUserWithCompanyIdAndCallIdAndIsDeletedFalse(userEntity.getId(), userWithCompanyEntity.getId(),call.getId());
// if(applicationEntity.isPresent()){
// throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_ALREADY_EXISTS));
// }
// }
public ApplicationResponse updateApplicationStatus(HttpServletRequest request, Long applicationId, ApplicationStatusTypeEnum status) {