-
Notifications
You must be signed in to change notification settings - Fork 25
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
Circ 2084 #1475
Circ 2084 #1475
Conversation
@@ -294,8 +296,14 @@ private Result<MultipleRecords<Loan>> mapResponseToLoans(Response response) { | |||
return MultipleRecords.from(response, Loan::from, RECORDS_PROPERTY_NAME); | |||
} | |||
|
|||
private static void addIsDcbProperty(Loan loan, Item item, JsonObject storageLoan) { | |||
write(storageLoan, IS_DCB, (nonNull(loan.getUser()) && nonNull(loan.getUser().getLastName()) | |||
&& loan.getUser().getLastName().equalsIgnoreCase("DcbSystem")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use string constants for DcbSystem
private static JsonObject mapToStorageRepresentation(Loan loan, Item item) { | ||
log.debug("mapToStorageRepresentation:: parameters loan: {}, item: {}", loan, item); | ||
log.info("mapToStorageRepresentation:: parameters loan: {}, item: {}", loan, item); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert this to debug level log
@SreejaMangarapu
|
…version to 7.3 in ModuleDescriptor
write(storageLoan, IS_DCB, (nonNull(loan.getUser()) && nonNull(loan.getUser().getLastName()) | ||
&& loan.getUser().getLastName().equalsIgnoreCase(DCB_USER_LASTNAME)) | ||
|| item.isDcbItem()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extract 3rd argument into a method, e.g. isDcbLoan(Loan loan, Item item)
. Also, we can probably do item.isDcbItem()
first because it's a quicker check, and then check user name.
public IndividualResource createCirculationItemForDcb(String barcode, UUID holdingId, UUID locationId, String instanceTitle,boolean isDcb) { | ||
CirculationItemsBuilder circulationItemsBuilder = new CirculationItemsBuilder().withBarcode(barcode).withHoldingId(holdingId) | ||
.withLoanType(loanTypesFixture.canCirculate().getId()).withMaterialType(materialTypesFixture.book().getId()) | ||
.withLocationId(locationId).withInstanceTitle(instanceTitle).withDcb(isDcb); | ||
return circulationItemClient.create(circulationItemsBuilder); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public IndividualResource createCirculationItemForDcb(String barcode, UUID holdingId, UUID locationId, String instanceTitle,boolean isDcb) { | |
CirculationItemsBuilder circulationItemsBuilder = new CirculationItemsBuilder().withBarcode(barcode).withHoldingId(holdingId) | |
.withLoanType(loanTypesFixture.canCirculate().getId()).withMaterialType(materialTypesFixture.book().getId()) | |
.withLocationId(locationId).withInstanceTitle(instanceTitle).withDcb(isDcb); | |
return circulationItemClient.create(circulationItemsBuilder); | |
} | |
public IndividualResource createCirculationItemForDcb(String barcode, UUID holdingId, | |
UUID locationId, String instanceTitle,boolean isDcb) { | |
CirculationItemsBuilder circulationItemsBuilder = new CirculationItemsBuilder() | |
.withBarcode(barcode) | |
.withHoldingId(holdingId) | |
.withLoanType(loanTypesFixture.canCirculate().getId()) | |
.withMaterialType(materialTypesFixture.book().getId()) | |
.withLocationId(locationId) | |
.withInstanceTitle(instanceTitle).withDcb(isDcb); | |
return circulationItemClient.create(circulationItemsBuilder); | |
} | |
@@ -93,6 +93,10 @@ | |||
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item", | |||
"type": "boolean" | |||
}, | |||
"isDcb": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the file name be storage-loan-7-3.json ?
…changes made in LoanRepository
Quality Gate passedIssues Measures |
Purpose
purpose of the pr - https://folio-org.atlassian.net/browse/CIRC-2084
Approach
checking if the item is dcb item by the feild isDcb of item and user is dcb user by the lastname of user , if they are related to dcb then adding a flag isDcb with value true for loan , if not adding isDcb = false for loan
TODOS and Open Questions
Learning