Merge branch 'develop' of https://github.com/Kitzanos/GEPAFIN-BE into develop

This commit is contained in:
Piyush
2025-02-03 18:07:37 +05:30
13 changed files with 154 additions and 6 deletions

View File

@@ -2201,5 +2201,23 @@ public class ApplicationEvaluationDao {
return evaluationFormResponseBean;
}
public ApplicationEvaluationVersionResponse getApplicationEvaluationVersion(HttpServletRequest request, Long applicationId){
log.info("Fetching application evaluation version with ID: {}", applicationId);
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationId);
return buildApplicationEvaluationVersionResponse(applicationEntity);
}
private ApplicationEvaluationVersionResponse buildApplicationEvaluationVersionResponse(ApplicationEntity applicationEntity) {
ApplicationEvaluationVersionResponse response = new ApplicationEvaluationVersionResponse();
response.setApplicationId(applicationEntity.getId());
response.setCallId(applicationEntity.getCall().getId());
response.setCompanyId(applicationEntity.getCompanyId());
response.setEvaluationVersion(EvaluationVersionEnum.valueOf(applicationEntity.getEvaluationVersion()));
response.setEvaluationId(applicationEntity.getApplicationEvaluationId());
return response;
}
}

View File

@@ -94,7 +94,15 @@ public class EmailNotificationDao {
subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
// bodyPlaceholders.put("{{legal_mail}}", legalMail);
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
String body;
if ("t7jh5wfg9QXylNaTZkPoE".equals(hubEntity.getUniqueUuid()) && templateType.equals(SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST)) {
bodyPlaceholders.put("{{email_signature}}", hubEntity.getEmailSignature());
bodyPlaceholders.put("{{platform_link}}",hubEntity.getDomainName());
body = Utils.replacePlaceholders(GepafinConstant.DOCUMENTATION_INTEGRATION_REQUEST_SVILUPPUMBRIA, bodyPlaceholders);
}
else {
body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
}
return new EmailContentResponse(subject, body, systemEmailTemplateResponse);
}

View File

@@ -36,6 +36,8 @@ import java.util.stream.Collectors;
@Component
public class FormDao {
private final Logger log = LoggerFactory.getLogger(FormDao.class);
@Autowired
private FormRepository formRepository;
@@ -203,8 +205,9 @@ public class FormDao {
String formFieldId,Long evaluationCriteriaId) {
EvaluationCriteriaEntity evaluationCriteria = evaluationCriteriaService.validateEvaluationCriteria(evaluationCriteriaId);
if (Boolean.FALSE.equals(evaluationCriteria.getCall().getId().equals(callEntity.getId()))) {
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.EVALUATIONCRITERIA_INVALID));
log.info("This evaluation criterion does not belong to the current call. Expected Call ID = {}, Found Call ID = {}",
callEntity.getId(), evaluationCriteria.getCall().getId());
return;
}
CriteriaFormFieldEntity criteriaFormField = new CriteriaFormFieldEntity();
criteriaFormField.setCallId(callEntity.getId());
@@ -471,7 +474,9 @@ public class FormDao {
FieldValidatorBean fieldValidatorBean = Utils.convertSourceObjectToDestinationObject(contentResponseBean.getValidators(), FieldValidatorBean.class);
String fieldValue = getFieldValue(contentResponseBean);
validator.isRequired(value, fieldValidatorBean.getIsRequired(), fieldValue);
validator.isRequired(value, fieldValidatorBean.getIsRequired(), fieldValue)
.validateCustomTableValidation(value,fieldValidatorBean.getCustom(),fieldValue,contentResponseBean);
});
if (Boolean.TRUE.equals(isSendValidationError)) {
validator.validate();