Updated code for evaluation-v2(call)

This commit is contained in:
Piyush
2025-01-24 19:33:47 +05:30
parent e64d10add6
commit 0ebd33e544
26 changed files with 214 additions and 36 deletions

View File

@@ -116,6 +116,9 @@ public class CallDao {
@Autowired
private NotificationTypeRepository notificationTypeRepository;
@Autowired
private EvaluationFormDao evalualtionFormDao;
public CallResponse createCallStep1(CreateCallRequestStep1 createCallRequest, UserEntity userEntity) {
createCallRequest.setRegionId(userEntity.getRoleEntity().getRegion().getId());
CallEntity callEntity = convertToCallEntity(createCallRequest, userEntity);
@@ -178,6 +181,7 @@ public class CallDao {
}
}
callEntity.setStatus(CallStatusEnum.DRAFT.getValue());
callEntity.setEvaluationVersion(createCallRequest.getEvaluationVersion().getValue());
callEntity.setAmountMax(createCallRequest.getAmountMax());
callEntity.setAmount(createCallRequest.getAmount());
callEntity.setConfidi(false);
@@ -362,6 +366,7 @@ public class CallDao {
createCallResponseBean.setDescriptionShort(callEntity.getDescriptionShort());
createCallResponseBean.setDescriptionLong(callEntity.getDescriptionLong());
createCallResponseBean.setStatus(CallStatusEnum.valueOf(callEntity.getStatus()));
createCallResponseBean.setEvaluationVersion(EvaluationVersionEnum.valueOf(callEntity.getEvaluationVersion()));
createCallResponseBean.setRegionId(callEntity.getRegion().getId());
createCallResponseBean.setAmount(callEntity.getAmount());
createCallResponseBean.setAmountMax(callEntity.getAmountMax());
@@ -601,6 +606,7 @@ public class CallDao {
setIfUpdated(callEntity::getStartTime, callEntity::setStartTime, DateTimeUtil.parseTime(updateCallRequest.getStartTime()));
setIfUpdated(callEntity::getEndTime, callEntity::setEndTime, DateTimeUtil.parseTime(updateCallRequest.getEndTime()));
setIfUpdated(callEntity::getConfidi, callEntity::setConfidi, updateCallRequest.getConfidi());
setIfUpdated(callEntity::getEvaluationVersion, callEntity::setEvaluationVersion, updateCallRequest.getEvaluationVersion().getValue());
callEntity = callRepository.save(callEntity);
/** This code is responsible for adding a version history log for the "update call step 1" operation **/
@@ -691,6 +697,7 @@ public class CallDao {
callDetailsResponseBean.setDescriptionShort(callEntity.getDescriptionShort());
callDetailsResponseBean.setDescriptionLong(callEntity.getDescriptionLong());
callDetailsResponseBean.setStatus(CallStatusEnum.valueOf(callEntity.getStatus()));
callDetailsResponseBean.setEvaluationVersion(EvaluationVersionEnum.valueOf(callEntity.getEvaluationVersion()));
callDetailsResponseBean.setRegionId(callEntity.getRegion().getId());
callDetailsResponseBean.setAmount(callEntity.getAmount());
callDetailsResponseBean.setAmountMax(callEntity.getAmountMax());
@@ -811,7 +818,8 @@ public class CallDao {
CallResponse callResponseBean = getCallResponseBean(callEntity);
FlowResponseBean flowResponseBean = flowDao.getFlowByCallId(callEntity.getId());
List<FormResponseBean> formResponseBean = formDao.getFormsByCallId(callEntity);
CallValidatorServiceImpl.validateResponse(callResponseBean,flowResponseBean,formResponseBean);
EvaluationFormResponseBean evaluationFormResponseBean = evalualtionFormDao.getEvaluationFormByCallId(callEntity);
CallValidatorServiceImpl.validateResponse(callResponseBean,flowResponseBean,formResponseBean,evaluationFormResponseBean);
callEntity.setStatus(CallStatusEnum.READY_TO_PUBLISH.getValue());
callEntity = callRepository.save(callEntity);
@@ -1063,4 +1071,15 @@ public class CallDao {
return predicates;
}
public CallResponse createCallStep2EvaluationV2(CallEntity callEntity, CreateCallRequestStep2EvaluationV2 createCallRequest, UserEntity user) {
convertToDocumentEntities(createCallRequest.getDocs(), callEntity.getId(), DocumentTypeEnum.DOCUMENT);
convertToDocumentEntities(createCallRequest.getImages(), callEntity.getId(), DocumentTypeEnum.IMAGES);
CallResponse createCallResponseBean = getCallResponseBean(callEntity);
createCallResponseBean.setCurrentStep(GepafinConstant.EVALUATION_V2_STEP_2);
return createCallResponseBean;
}
}