Skip to content

Commit

Permalink
Add holdingsCopyNumber and ItemsCopyNumber to rtac response
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-murodov-epam committed Feb 26, 2024
1 parent 4fa1459 commit ecf509f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ramls/batch-holdings.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<xs:element name="tempLocation" type="xs:string" minOccurs="0"/>
<xs:element name="volume" type="xs:string" minOccurs="0"/>
<xs:element name="temporaryLoanType" type="xs:string" minOccurs="0"/>
<xs:element name="permanentLoanType" type="xs:string" minOccurs="0"/>
<xs:element name="holdingsCopyNumber" type="xs:string" minOccurs="0"/>
<xs:element name="itemCopyNumber" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
2 changes: 2 additions & 0 deletions ramls/holdings.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<xs:element name="dueDate" type="xs:string"/>
<xs:element name="tempLocation" type="xs:string" minOccurs="0"/>
<xs:element name="volume" type="xs:string" minOccurs="0"/>
<xs:element name="holdingsCopyNumber" type="xs:string" minOccurs="0"/>
<xs:element name="itemCopyNumber" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/org/folio/edge/rtac/model/Holding.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public final class Holding {
private final String temporaryLoanType;
@JsonProperty("permanentLoanType")
private final String permanentLoanType;
@JsonProperty("holdingsCopyNumber")
private final String holdingsCopyNumber;
@JsonProperty("itemCopyNumber")
private final String itemCopyNumber;

@Override
public boolean equals(Object o) {
Expand All @@ -48,11 +52,14 @@ public boolean equals(Object o) {
Objects.equals(tempLocation, holding.tempLocation) &&
Objects.equals(volume, holding.volume) &&
Objects.equals(temporaryLoanType, holding.temporaryLoanType) &&
Objects.equals(permanentLoanType, holding.permanentLoanType);
Objects.equals(permanentLoanType, holding.permanentLoanType) &&
Objects.equals(holdingsCopyNumber, holding.holdingsCopyNumber) &&
Objects.equals(itemCopyNumber, holding.itemCopyNumber);
}

@Override
public int hashCode() {
return Objects.hash(id, callNumber, location, status, dueDate, tempLocation, volume, temporaryLoanType, permanentLoanType);
return Objects.hash(id, callNumber, location, status, dueDate, tempLocation, volume, temporaryLoanType, permanentLoanType,
holdingsCopyNumber, itemCopyNumber);
}
}
14 changes: 13 additions & 1 deletion src/test/java/org/folio/edge/rtac/model/InstancesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,33 @@ public void setUp() throws Exception {
.status("Item in place")
.dueDate("")
.volume("v.10:no.2")
.itemCopyNumber("101")
.build();

Holding h2 = Holding.builder()
.id("99712686103569")
.callNumber("PS3552.E796 D44x 1975")
.location("LC General Collection Millersville University Library")
.status("Item in place")
.holdingsCopyNumber("201")
.dueDate("2018-04-23 12:00:00")
.build();

Holding h3 = Holding.builder()
.id("99712686103569")
.callNumber("PS3552.E796 D44x 1975")
.location("LC General Collection Millersville University Library")
.status("Item in place")
.itemCopyNumber("102")
.holdingsCopyNumber("202")
.dueDate("2018-04-23 12:00:00")
.build();

instances = new Instances();

final var holdings = new Holdings();
holdings.setInstanceId(INSTANCE_ID);
holdings.setHoldings(List.of(h1, h2));
holdings.setHoldings(List.of(h1, h2, h3));
instances.setHoldings(List.of(holdings));

SchemaFactory schemaFactory = SchemaFactory
Expand Down

0 comments on commit ecf509f

Please sign in to comment.