From de909f187c807a4763d0e321ce86559ab4b5e75d Mon Sep 17 00:00:00 2001 From: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:26:04 +0530 Subject: [PATCH] Hcmpre 639 shashwat changes (#919) * Removed the project facility mapping validation check as it is not required * Removed the project facilty valaidation check in ValidatorUtil.java * Removed the local receiverId in ValidatorUtil.java --------- Co-authored-by: Shashwat12-egov --- .../main/java/org/egov/stock/service/FacilityService.java | 3 --- .../src/main/java/org/egov/stock/util/ValidatorUtil.java | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/health-services/stock/src/main/java/org/egov/stock/service/FacilityService.java b/health-services/stock/src/main/java/org/egov/stock/service/FacilityService.java index 2951b21e031..723fd98f967 100644 --- a/health-services/stock/src/main/java/org/egov/stock/service/FacilityService.java +++ b/health-services/stock/src/main/java/org/egov/stock/service/FacilityService.java @@ -99,9 +99,6 @@ public Map> validateProjectFacilityMappings(List ent if (SenderReceiverType.WAREHOUSE.equals(stock.getSenderType())) { facilityIds.add(stock.getSenderId()); } - if (SenderReceiverType.WAREHOUSE.equals(stock.getReceiverType())) { - facilityIds.add(stock.getReceiverId()); - } } } diff --git a/health-services/stock/src/main/java/org/egov/stock/util/ValidatorUtil.java b/health-services/stock/src/main/java/org/egov/stock/util/ValidatorUtil.java index d71f92cda2d..4f975144e32 100644 --- a/health-services/stock/src/main/java/org/egov/stock/util/ValidatorUtil.java +++ b/health-services/stock/src/main/java/org/egov/stock/util/ValidatorUtil.java @@ -266,7 +266,6 @@ private static void enrichErrorForStock(List validEntities, for (Stock stock : validEntities) { String senderId = stock.getSenderId(); - String receiverId = stock.getReceiverId(); List facilityIds = ProjectFacilityMappingOfIds.get(stock.getReferenceId()); if (!CollectionUtils.isEmpty(facilityIds)) { @@ -274,11 +273,8 @@ private static void enrichErrorForStock(List validEntities, if (SenderReceiverType.WAREHOUSE.equals(stock.getSenderType()) && !facilityIds.contains(senderId)) { populateErrorForStock(stock, senderId, errorDetailsMap); } - - if (SenderReceiverType.WAREHOUSE.equals(stock.getReceiverType()) && !facilityIds.contains(receiverId)) - populateErrorForStock(stock, receiverId, errorDetailsMap); } else { - populateErrorForStock(stock, senderId + " and " + receiverId, errorDetailsMap); + populateErrorForStock(stock, senderId, errorDetailsMap); } } }