Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hcmpre 639 shashwat changes #919

Merged
merged 6 commits into from
Sep 30, 2024
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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove receiverId local property as it is not being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
populateErrorForStock(stock, senderId + " and " + receiverId, errorDetailsMap);
populateErrorForStock(stock, senderId, errorDetailsMap);
}
}
}
Expand Down
Loading