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

MODDCB-59 DCB item effective location in Staff Slips #55

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class TransactionEntity extends AuditableEntity {
private String patronBarcode;
private String borrowingLibraryCode;
private UUID requestId;
private String agencyCode;
@Enumerated(EnumType.STRING)
private StatusEnum status;
@Enumerated(EnumType.STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public TransactionEntity mapToEntity(String transactionId, DcbTransaction dcbTra
.patronId(patron.getId())
.patronGroup(patron.getGroup())
.borrowingLibraryCode(patron.getBorrowingLibraryCode())
.agencyCode(item.getAgencyCode())

.role(dcbTransaction.getRole())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private void createCirculationItem(DcbItem item, String pickupServicePointId){
.materialTypeId(materialTypeId)
.permanentLoanTypeId(LOAN_TYPE_ID)
.pickupLocation(pickupServicePointId)
.agencyCode(item.getAgencyCode())
.build();

circulationItemClient.createCirculationItem(item.getId(), circulationItemRequest);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<include file="changes/create-transaction-table.xml" relativeToChangelogFile="true"/>
<include file="changes/create-audit-table.xml" relativeToChangelogFile="true"/>
<include file="changes/add-request-to-transaction.xml" relativeToChangelogFile="true"/>
<include file="changes/add-agency-code.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
16 changes: 16 additions & 0 deletions src/main/resources/db/changelog/changes/add-agency-code.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<!-- Add agencyCode column -->
<changeSet id="addAgencyCodeColumn" author="magzhanArtykov">
<addColumn tableName="transactions">
<column name="agency_code" type="text">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ CirculationItemRequest:
type: string
pickupLocation:
type: string
agencyCode:
type: string
additionalProperties: false
3 changes: 3 additions & 0 deletions src/main/resources/swagger.api/schemas/dcbItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ DcbItem:
lendingLibraryCode:
description: The code which identifies the lending library
type: string
agencyCode:
description: Effective 5 character agency code
type: string
2 changes: 2 additions & 0 deletions src/test/java/org/folio/dcb/utils/EntityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public static DcbItem createDcbItem() {
.title("ITEM")
.lendingLibraryCode("KU")
.materialType("book")
.agencyCode("11191")
.build();
}

Expand Down Expand Up @@ -158,6 +159,7 @@ public static TransactionEntity createTransactionEntity() {
.materialType("book")
.lendingLibraryCode("LEN")
.borrowingLibraryCode("BOR")
.agencyCode("11191")
.requestId(UUID.fromString(CIRCULATION_REQUEST_ID))
.build();
}
Expand Down