Skip to content

Commit

Permalink
MCBFF-38: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
imerabishvili committed Jan 27, 2025
1 parent 574aeb3 commit b6df732
Showing 1 changed file with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ private String getEffectiveLocationServicePoint(String itemId) {
log.warn("getEffectiveLocationServicePoint: instance not found");
return null;
}
var itemTenantId = instance.getItems()
.stream()
.filter(item -> item.getId().equals(itemId))
.findFirst()
.map(SearchItem::getTenantId)
.orElse(null);
var tenantId = instance.getItems()
.stream()
.filter(item -> item.getId().equals(itemId))
Expand All @@ -69,7 +63,7 @@ private String getEffectiveLocationServicePoint(String itemId) {
return executionService.executeSystemUserScoped(tenantId, () -> fetchServicePointName(itemId));
}
}

private String fetchServicePointName(String itemId) {
var item = inventoryService.fetchItem(itemId);
if (item == null) {
Expand All @@ -92,25 +86,6 @@ private String fetchServicePointName(String itemId) {
log.info("fetchServicePointName:: result: {}", servicePointName);

return servicePointName;
}
log.info("getEffectiveLocationServicePoint: same tenant case {}", itemTenantId);
var item = inventoryService.fetchItem(itemId);
var location = inventoryService.fetchLocation(item.getEffectiveLocationId());
var servicePoint = inventoryService.fetchServicePoint(location.getPrimaryServicePoint().toString());
return servicePoint.getName();
} else {
log.info("getEffectiveLocationServicePoint: cross tenant case {}", itemTenantId);
var item = executionService.executeSystemUserScoped(itemTenantId,
() -> inventoryService.fetchItem(itemId)
);
var location = executionService.executeSystemUserScoped(itemTenantId,
() -> inventoryService.fetchLocation(item.getEffectiveLocationId())
);
var servicePoint = executionService.executeSystemUserScoped(itemTenantId,
() -> inventoryService.fetchServicePoint(location.getPrimaryServicePoint().toString())
);
return servicePoint.getName();
}
}

}

0 comments on commit b6df732

Please sign in to comment.