Merge branch 'develop' of https://github.com/Kitzanos/GEPAFIN-BE into develop
This commit is contained in:
@@ -207,7 +207,7 @@ public class ApplicationAmendmentRequestDao {
|
||||
applicationAmendmentRequestEntity.setIsEmail(applicationAmendmentRequest.getIsSendEmail());
|
||||
applicationAmendmentRequestEntity.setIsNotification(applicationAmendmentRequest.getIsSendNotification());
|
||||
applicationAmendmentRequestEntity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||
applicationAmendmentRequestEntity.setStatus(ApplicationAmendmentRequestEnum.AWATING.getValue());
|
||||
applicationAmendmentRequestEntity.setStatus(ApplicationAmendmentRequestEnum.AWAITING.getValue());
|
||||
ApplicationEvaluationEntity applicationEvaluationEntity = applicationEvaluationService.validateApplicationEvaluation(applicationEvaluationId);
|
||||
|
||||
applicationAmendmentRequestEntity.setApplicationEvaluationEntity(applicationEvaluationEntity);
|
||||
@@ -554,8 +554,9 @@ public class ApplicationAmendmentRequestDao {
|
||||
|
||||
log.info("Updating application amendement with status: {}", id);
|
||||
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
|
||||
if(Boolean.TRUE.equals(existingApplicationAmendment.getStatus().equals(ApplicationAmendmentRequestEnum.AWATING.getValue())) && Boolean.TRUE.equals(statusTypeEnum.equals(ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED))){
|
||||
if(Boolean.TRUE.equals(existingApplicationAmendment.getStatus().equals(ApplicationAmendmentRequestEnum.AWAITING.getValue())) && Boolean.TRUE.equals(statusTypeEnum.equals(ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED))){
|
||||
existingApplicationAmendment.setStatus(ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED.getValue());
|
||||
existingApplicationAmendment.setUpdatedDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||
applicationAmendmentRequestRepository.save(existingApplicationAmendment);
|
||||
}
|
||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(existingApplicationAmendment);
|
||||
|
||||
@@ -5,10 +5,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import net.gepafin.tendermanagement.config.SamlSuccessHandler;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.entities.BeneficiaryEntity;
|
||||
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||
import net.gepafin.tendermanagement.entities.RoleEntity;
|
||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||
import net.gepafin.tendermanagement.entities.*;
|
||||
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
||||
import net.gepafin.tendermanagement.model.request.*;
|
||||
@@ -80,6 +77,9 @@ public class UserDao {
|
||||
@Autowired
|
||||
private HubService hubService;
|
||||
|
||||
@Autowired
|
||||
private AuthenticationService authenticationService;
|
||||
|
||||
|
||||
public JWTToken createUser(HttpServletRequest request, String tempToken, UserReq userReq) {
|
||||
if(StringUtils.isEmpty(userReq.getHubUuid())) {
|
||||
@@ -92,6 +92,14 @@ public class UserDao {
|
||||
BeneficiaryEntity beneficiary = createBeneficiary(roleEntity, userReq, hub);
|
||||
UserEntity userEntity = convertUserRequestToUserEntity(beneficiary, roleEntity, userReq, hub);
|
||||
log.info("User created with ID: {}", userEntity.getId());
|
||||
LoginReq loginReq=new LoginReq();
|
||||
loginReq.setEmail(userEntity.getEmail());
|
||||
if(userEntity!=null){
|
||||
LoginAttemptEntity loginAttemptEntity =authenticationService.prepareLoginAttemptEntity(loginReq, request);
|
||||
log.info("Authentication failed for email: {}", loginReq.getEmail());
|
||||
loginAttemptEntity.setUserId(userEntity.getId());
|
||||
authenticationService.createSuccessLoginAttempt(loginAttemptEntity);
|
||||
}
|
||||
return authService.getJWTTokenBean(userEntity, Boolean.TRUE);
|
||||
}
|
||||
|
||||
@@ -403,8 +411,8 @@ public class UserDao {
|
||||
return userResponseBeans;
|
||||
}
|
||||
|
||||
public JWTToken validateExistingUserToken(String token) {
|
||||
return authService.validateExistingUserToken(token);
|
||||
public JWTToken validateExistingUserToken(HttpServletRequest request,String token) {
|
||||
return authService.validateExistingUserToken(request,token);
|
||||
}
|
||||
|
||||
public UserSamlResponse validateNewUserToken(String token) {
|
||||
|
||||
Reference in New Issue
Block a user