Merge pull request #94 from Kitzanos/feature/GEPAFINBE-95-removed-validation-published-call

GEPAFINBE-95(Removed  published call validation )
This commit is contained in:
rbonazzo-KZ
2024-11-15 08:23:31 +01:00
committed by GitHub
4 changed files with 4 additions and 11 deletions

View File

@@ -442,7 +442,7 @@ public class CallDao {
public CallResponse createCallStep2(CallEntity callEntity, CreateCallRequestStep2 createCallRequest, UserEntity user) { public CallResponse createCallStep2(CallEntity callEntity, CreateCallRequestStep2 createCallRequest, UserEntity user) {
validateUpdate(callEntity); // validateUpdate(callEntity);
setIfUpdated(callEntity::getThreshold, callEntity::setThreshold, createCallRequest.getThreshold()); setIfUpdated(callEntity::getThreshold, callEntity::setThreshold, createCallRequest.getThreshold());
callRepository.save(callEntity); callRepository.save(callEntity);
convertToEvaluationCriteriaEntities(createCallRequest.getCriteria(), callEntity, LookUpDataTypeEnum.EVALUATION_CRITERIA); convertToEvaluationCriteriaEntities(createCallRequest.getCriteria(), callEntity, LookUpDataTypeEnum.EVALUATION_CRITERIA);
@@ -502,13 +502,6 @@ public class CallDao {
} }
public CallResponse updateCallStep1(CallEntity callEntity, UpdateCallRequestStep1 updateCallRequest, UserEntity userEntity) { public CallResponse updateCallStep1(CallEntity callEntity, UpdateCallRequestStep1 updateCallRequest, UserEntity userEntity) {
if(Boolean.TRUE.equals(callEntity.getStatus().equals(CallStatusEnum.PUBLISH.getValue()))) {
try {
Utils.retainOnlySpecificFields(updateCallRequest, Collections.singletonList("faq"));
} catch (IllegalAccessException e) {
throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.FAILED_RETAIN_FIELD));
}
}
isValidDateRange(updateCallRequest, callEntity); isValidDateRange(updateCallRequest, callEntity);
setIfUpdated(callEntity::getName, callEntity::setName, updateCallRequest.getName()); setIfUpdated(callEntity::getName, callEntity::setName, updateCallRequest.getName());
setIfUpdated(callEntity::getDescriptionShort, callEntity::setDescriptionShort, setIfUpdated(callEntity::getDescriptionShort, callEntity::setDescriptionShort,

View File

@@ -97,7 +97,7 @@ public class DocumentDao {
private Long resolveSourceId(Long sourceId, DocumentSourceTypeEnum sourceType) { private Long resolveSourceId(Long sourceId, DocumentSourceTypeEnum sourceType) {
if (sourceType == DocumentSourceTypeEnum.CALL) { if (sourceType == DocumentSourceTypeEnum.CALL) {
CallEntity callEntity = callService.validateCall(sourceId); CallEntity callEntity = callService.validateCall(sourceId);
callDao.validateUpdate(callEntity); // callDao.validateUpdate(callEntity);
return callEntity.getId(); return callEntity.getId();
} }
// else if (sourceType == SourceTypeEnum.APPLICATION) { // else if (sourceType == SourceTypeEnum.APPLICATION) {

View File

@@ -72,7 +72,7 @@ public class FlowDao {
} }
public void checkIfFlowExits(CallEntity call) { public void checkIfFlowExits(CallEntity call) {
callDao.validateUpdate(call); // callDao.validateUpdate(call);
List<FlowDataEntity> flowDataEntities = flowDataRepository.findByCallId(call.getId()); List<FlowDataEntity> flowDataEntities = flowDataRepository.findByCallId(call.getId());
List<FlowEdgesEntity> flowEdgesEntities = flowEdgesRepository.findByCallId(call.getId()); List<FlowEdgesEntity> flowEdgesEntities = flowEdgesRepository.findByCallId(call.getId());
if (Boolean.FALSE.equals(flowDataEntities.isEmpty()) || Boolean.FALSE.equals(flowEdgesEntities.isEmpty())) { if (Boolean.FALSE.equals(flowDataEntities.isEmpty()) || Boolean.FALSE.equals(flowEdgesEntities.isEmpty())) {

View File

@@ -173,7 +173,7 @@ public class FormDao {
String choosenField=null; String choosenField=null;
FormEntity formEntity = validateForm(formId); FormEntity formEntity = validateForm(formId);
validator.validateUserWithCall(user, formEntity.getCall().getId()); validator.validateUserWithCall(user, formEntity.getCall().getId());
callDao.validateUpdate(formEntity.getCall()); // callDao.validateUpdate(formEntity.getCall());
List<ContentRequestBean> contentRequestBean = Utils.convertJsonStringToList(formEntity.getContent(), ContentRequestBean.class); List<ContentRequestBean> contentRequestBean = Utils.convertJsonStringToList(formEntity.getContent(), ContentRequestBean.class);
for (ContentRequestBean contentRequestBean1 : contentRequestBean) { for (ContentRequestBean contentRequestBean1 : contentRequestBean) {
FlowDataEntity flowDataEntity = flowDataRepository.findByFormIdAndChoosenField(formEntity.getId(), contentRequestBean1.getId()); FlowDataEntity flowDataEntity = flowDataRepository.findByFormIdAndChoosenField(formEntity.getId(), contentRequestBean1.getId());