Skip to content

Commit

Permalink
Hcmpre 639 shashwat changes (#919)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
kanishq-egov and Shashwat12-egov authored Sep 30, 2024
1 parent 958201f commit de909f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ public <T> Map<String, List<String>> validateProjectFacilityMappings(List<T> ent
if (SenderReceiverType.WAREHOUSE.equals(stock.getSenderType())) {
facilityIds.add(stock.getSenderId());
}
if (SenderReceiverType.WAREHOUSE.equals(stock.getReceiverType())) {
facilityIds.add(stock.getReceiverId());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,15 @@ private static <T> void enrichErrorForStock(List<Stock> validEntities,
for (Stock stock : validEntities) {

String senderId = stock.getSenderId();
String receiverId = stock.getReceiverId();

List<String> facilityIds = ProjectFacilityMappingOfIds.get(stock.getReferenceId());
if (!CollectionUtils.isEmpty(facilityIds)) {

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);
}
}
}
Expand Down

0 comments on commit de909f1

Please sign in to comment.