Skip to content

Commit

Permalink
HLM-3376: removed not used validators
Browse files Browse the repository at this point in the history
  • Loading branch information
kanishq-egov committed Oct 19, 2023
1 parent afa0ee5 commit 088ae72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 253 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
package org.egov.referralmanagement.service;

import lombok.extern.slf4j.Slf4j;
import org.egov.common.ds.Tuple;
import org.egov.common.models.ErrorDetails;
import org.egov.common.models.referralmanagement.Referral;
import org.egov.common.models.referralmanagement.ReferralBulkRequest;
import org.egov.common.models.referralmanagement.ReferralRequest;
import org.egov.common.models.referralmanagement.ReferralSearchRequest;
import org.egov.common.service.IdGenService;
import org.egov.common.utils.CommonUtils;
import org.egov.common.validator.Validator;
import org.egov.referralmanagement.Constants;
import org.egov.referralmanagement.config.ReferralManagementConfiguration;
import org.egov.referralmanagement.repository.ReferralRepository;
import org.egov.referralmanagement.service.enrichment.ReferralManagementEnrichmentService;
import org.egov.referralmanagement.validator.RmFacilityEntitiesIdValidator;
import org.egov.referralmanagement.validator.RmIsDeletedValidator;
import org.egov.referralmanagement.validator.RmNonExistentEntityValidator;
import org.egov.referralmanagement.validator.RmNullIdValidator;
import org.egov.referralmanagement.validator.RmProjectBeneficiaryIdValidator;
import org.egov.referralmanagement.validator.RmProjectEntitiesIdValidator;
import org.egov.referralmanagement.validator.RmRecipientIdValidator;
import org.egov.referralmanagement.validator.RmSideEffectIdValidator;
import org.egov.referralmanagement.validator.RmUniqueEntityValidator;
import org.egov.common.ds.Tuple;
import org.egov.common.models.ErrorDetails;
import org.egov.common.models.referralmanagement.Referral;
import org.egov.common.models.referralmanagement.ReferralBulkRequest;
import org.egov.common.models.referralmanagement.ReferralRequest;
import org.egov.common.models.referralmanagement.ReferralSearchRequest;
import org.egov.common.service.IdGenService;
import org.egov.common.utils.CommonUtils;
import org.egov.common.validator.Validator;
import org.egov.tracer.model.CustomException;
import org.springframework.stereotype.Service;
import org.springframework.util.ReflectionUtils;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ public Map<Referral, List<Error>> validate(ReferralBulkRequest request) {
if (Objects.nonNull(referral.getSideEffect()))
addIgnoreNull(sideEffectIds, referral.getSideEffect().getId());
});
List<String> validSideEffectIds;
try {
validSideEffectIds = sideEffectService.search(
SideEffectSearchRequest.builder().sideEffect(SideEffectSearch.builder().id(sideEffectIds).build()).build(),
sideEffectIds.size(), 0, tenantId, null, false
).stream().map(SideEffect::getId).collect(Collectors.toList());
} catch (Exception e) {
throw new CustomException("Side Effect failed to fetch", "Exception : " + e.getMessage());
List<String> validSideEffectIds = new ArrayList<>();
if(!sideEffectIds.isEmpty()) {
try {
validSideEffectIds = sideEffectService.search(
SideEffectSearchRequest.builder().sideEffect(SideEffectSearch.builder().id(sideEffectIds).build()).build(),
sideEffectIds.size(), 0, tenantId, null, false
).stream().map(SideEffect::getId).collect(Collectors.toList());
} catch (Exception e) {
throw new CustomException("Side Effect failed to fetch", "Exception : " + e.getMessage());
}
}
sideEffectIds.removeAll(validSideEffectIds);
List<String> invalidSideEffectIds = new ArrayList<>(sideEffectIds);
Expand Down

0 comments on commit 088ae72

Please sign in to comment.