Removed validation for published call to restrict updates on the call
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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())) {
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user