Skip to content

Commit

Permalink
CIRC-2148: code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kapil-epam committed Sep 13, 2024
1 parent 4b966f6 commit b2d0ba8
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,21 @@ public JsonObject extendedRepresentation(Request request) {

private void addPrintDetailsProperties(Request request, JsonObject requestRepresentation) {
JsonObject printDetails = requestRepresentation.getJsonObject("printDetails");
if (printDetails != null) {
User printDetailsUser = request.getPrintDetailsRequester();

if (printDetailsUser != null) {
JsonObject lastPrintRequester = new JsonObject();
lastPrintRequester.put("firstName", printDetailsUser.getFirstName());
lastPrintRequester.put("lastName", printDetailsUser.getLastName());
lastPrintRequester.put("middleName", printDetailsUser.getMiddleName());
printDetails.put("lastPrintRequester", lastPrintRequester);
if (printDetails == null) {
if (log.isInfoEnabled()) {
log.info("addPrintEventProperties:: printDetails property is null for" +
" requestId {}", requestRepresentation.getString("id"));
}
return;
}

User printDetailsUser = request.getPrintDetailsRequester();
if (printDetailsUser != null) {
JsonObject lastPrintRequester = new JsonObject();
lastPrintRequester.put("firstName", printDetailsUser.getFirstName());
lastPrintRequester.put("lastName", printDetailsUser.getLastName());
lastPrintRequester.put("middleName", printDetailsUser.getMiddleName());
printDetails.put("lastPrintRequester", lastPrintRequester);
}
}

Expand Down

0 comments on commit b2d0ba8

Please sign in to comment.