forked from folio-org/mod-circulation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CIRC-2100 Fetch print details while fetching request details based on…
… cql query (folio-org#1486) * CIRC-2100 Fetching print event details for request when request is fetched by CQL query * CIRC-2100 Fixing build issue * CIRC-2100 Adding loggers * CIRC-2100 Changing property name * CIRC-2100 Code Refactoring * CIRC-2100 Fixing NPE * CIRC-2100 Fetching print event details only when required * CIRC-2100 Avoiding extra user API call * CIRC-2100 Fixing sonar issue * CIRC-2100 code formatting * CIRC-2100 Adding loggers * CIRC-2100 Return 204 for post api and fixing test cases * CIRC-2100 Changes made as per the review comments and refactoring code
- Loading branch information
1 parent
4b4301b
commit 5e3559d
Showing
16 changed files
with
510 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/org/folio/circulation/domain/PrintEventDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.folio.circulation.domain; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import lombok.AllArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.With; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
import static org.folio.circulation.support.json.JsonPropertyFetcher.getDateTimeProperty; | ||
import static org.folio.circulation.support.json.JsonPropertyFetcher.getIntegerProperty; | ||
import static org.folio.circulation.support.json.JsonPropertyFetcher.getProperty; | ||
|
||
|
||
@AllArgsConstructor | ||
@Log4j2 | ||
public class PrintEventDetail { | ||
@ToString.Include | ||
private final JsonObject representation; | ||
@With | ||
private final User printeduser; | ||
|
||
public static PrintEventDetail from(JsonObject representation) { | ||
return new PrintEventDetail(representation, null); | ||
} | ||
|
||
public String getUserId() { | ||
return getProperty(representation, "requesterId"); | ||
} | ||
|
||
public String getRequestId() { | ||
return getProperty(representation, "requestId"); | ||
} | ||
|
||
public int getCount() { | ||
return getIntegerProperty(representation, "count", 0); | ||
} | ||
|
||
public ZonedDateTime getPrintEventDate() { | ||
return getDateTimeProperty(representation, "printEventDate"); | ||
} | ||
|
||
public User getUser() { | ||
return printeduser; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.