Skip to content

Commit

Permalink
Merge branch 'master' into ecs-tlr-feature
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/org/folio/circulation/domain/Item.java
#	src/main/java/org/folio/circulation/domain/Request.java
#	src/test/java/api/requests/RequestsAPIRetrievalTests.java
#	src/test/java/api/support/builders/RequestBuilder.java
  • Loading branch information
alexanderkurash committed Oct 18, 2024
2 parents 0907443 + 68d3d5c commit afcd021
Show file tree
Hide file tree
Showing 63 changed files with 1,436 additions and 117 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 24.3.0

* [CIRC-2156](https://folio-org.atlassian.net/browse/CIRC-2156) Upgrade "holdings-storage" to 8.0

## 24.2.0 2024-03-21

* Update `feesfines` interface version to 19.0 (CIRC-1914)
Expand Down
42 changes: 35 additions & 7 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
},
{
"id": "circulation",
"version": "14.2",
"version": "14.4",
"handlers": [
{
"methods": [
Expand Down Expand Up @@ -755,6 +755,23 @@
}
]
},
{
"id": "print-events",
"version": "1.0",
"handlers": [
{
"methods": ["POST"],
"pathPattern": "/circulation/print-events-entry",
"permissionsRequired": [
"circulation.print-events-entry.item.post"
],
"modulePermissions": [
"print-events-storage.print-events-entry.item.post",
"circulation-storage.circulation-settings.collection.get"
]
}
]
},
{
"id": "_timer",
"version": "1.0",
Expand Down Expand Up @@ -1215,15 +1232,15 @@
},
{
"id": "instance-storage",
"version": "4.0 5.0 6.0 7.0 8.0 9.0 10.0"
"version": "4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0"
},
{
"id": "holdings-storage",
"version": "1.3 2.0 3.0 4.0 5.0 6.0 7.0"
"version": "1.3 2.0 3.0 4.0 5.0 6.0 7.0 8.0"
},
{
"id": "request-storage",
"version": "6.0"
"version": "6.1"
},
{
"id": "request-storage-batch",
Expand Down Expand Up @@ -1323,7 +1340,7 @@
},
{
"id": "notes",
"version": "1.0 2.0 3.0"
"version": "4.0"
},
{
"id": "actual-cost-record-storage",
Expand All @@ -1336,6 +1353,10 @@
{
"id": "circulation-settings-storage",
"version": "1.0"
},
{
"id": "print-events-storage",
"version": "1.0"
}
],
"optional": [
Expand All @@ -1345,6 +1366,11 @@
}
],
"permissionSets": [
{
"permissionName": "circulation.print-events-entry.item.post",
"displayName": "circulation - create print events",
"description": "create print event logs"
},
{
"permissionName": "circulation.requests.queue.reorder.collection.post",
"displayName": "circulation - reorder queue for an item",
Expand Down Expand Up @@ -2312,7 +2338,6 @@
"pubsub.publish.post",
"note.types.collection.get",
"notes.item.post",
"notes.domain.all",
"actual-cost-record-storage.actual-cost-records.item.post",
"actual-cost-record-storage.actual-cost-records.collection.get",
"actual-cost-record-storage.actual-cost-records.item.get",
Expand Down Expand Up @@ -2391,7 +2416,6 @@
"addresstypes.collection.get",
"notes.item.post",
"note.types.collection.get",
"notes.domain.all",
"pubsub.publish.post"
],
"visible": false
Expand Down Expand Up @@ -2468,6 +2492,10 @@
"circulation.internal.fetch-items",
"circulation-storage.requests.item.get",
"circulation-storage.requests.collection.get",
"inventory-storage.holdings.item.get",
"inventory-storage.holdings.collection.get",
"inventory-storage.instances.item.get",
"inventory-storage.instances.collection.get",
"users.item.get",
"users.collection.get",
"addresstypes.item.get",
Expand Down
7 changes: 5 additions & 2 deletions ramls/examples/loan.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
{
"name": "Steve Jones"
}
]
],
"primaryContributor" : "Steve Jones"
},
"loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
"loanPolicy": {
Expand All @@ -37,7 +38,9 @@
"firstName" : "FirstName",
"lastName" : "LastName",
"middleName" : "MiddleName",
"barcode" : "102322966933815"
"barcode" : "102322966933815",
"preferredFirstName" : "preferredFirstName",
"patronGroup" : "3684a786-6671-4268-8ed0-9db82ebca60b"
},
"loanDate": "2017-03-01T23:11:00.000Z",
"dueDate": "2017-04-01T23:11:00.000Z",
Expand Down
9 changes: 9 additions & 0 deletions ramls/examples/print-events-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"requestIds": [
"059e54bb-53e5-4039-a2fb-b34358e88b0a",
"e70dcbae-30c6-47ac-94f8-4ffefd44a935"
],
"requesterId": "d51470ea-5daa-480b-a4aa-09c8c6d9940e",
"requesterName": "requester",
"printEventDate": "2024-06-25T20:00:00+05:30"
}
11 changes: 11 additions & 0 deletions ramls/examples/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,16 @@
"callNumber": "F16.H37 A2 9001"
},
"pickupServicePointName": "Circ Desk 1"
},
"printDetails": {
"printCount": 32,
"requesterId": "21457ab5-4635-4e56-906a-908f05e9233b",
"isPrinted": true,
"printEventDate": "2024-09-13T06:34:16.035+00:00",
"lastPrintRequester": {
"firstName": "firstName",
"lastName": "lastName",
"middleName": "middleName"
}
}
}
15 changes: 15 additions & 0 deletions ramls/loan.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
"description": "barcode used to identify the borrower (read only, defined by the server)",
"type": "string",
"readonly": true
},
"preferredFirstName": {
"description": "preferred first name of the borrower (read only, defined by the server)",
"type": "string",
"readonly": true
},
"patronGroup": {
"description": "current patron group of the borrower (read only, defined by the server)",
"type": "string",
"readonly": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -158,6 +168,11 @@
"additionalProperties": false
}
},
"primaryContributor": {
"description": "primary contributor of the item",
"type": "string",
"readonly": true
},
"holdingsRecordId": {
"description": "The ID of the holdings for the item",
"type": "string",
Expand Down
56 changes: 55 additions & 1 deletion ramls/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"requestLevel": {
"description": "Level of the request - Item or Title",
"type": "string",
"enum": ["Item"]
"enum": ["Item", "Title"]
},
"requestDate": {
"description": "Date the request was made",
Expand Down Expand Up @@ -358,6 +358,56 @@
}
}
},
"printDetails": {
"description": "The print details of the request",
"type": "object",
"readonly": true,
"properties": {
"printCount": {
"description": "Total no of times the request is printed",
"type": "integer",
"readOnly": true
},
"requesterId": {
"description": "User uuid of last print requester",
"type": "string",
"readOnly": true
},
"isPrinted": {
"description": "Whether the request is ever printed",
"type": "boolean",
"readOnly": true
},
"printEventDate": {
"description": "Recent printed time of the request",
"type": "string",
"format": "date-time",
"readOnly": true
},
"lastPrintRequester": {
"description": "Details of the User who printed the request recently",
"readonly": true,
"type": "object",
"properties": {
"firstName": {
"description": "first name of the user",
"type": "string",
"readonly": true
},
"lastName": {
"description": "last name of the user",
"type": "string",
"readonly": true
},
"middleName": {
"description": "middle name of the user",
"type": "string",
"readonly": true
}
}
}
}
},
"tags": {
"type": "object",
"description": "Tags",
Expand All @@ -383,6 +433,10 @@
"description": "Request fields used for search",
"type": "object",
"$ref": "request-search-index.json"
},
"itemLocationCode": {
"description": "Allow specifying item location when creating title-level requests",
"type": "string"
}
},
"additionalProperties": false,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/folio/circulation/CirculationVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.folio.circulation.resources.OverdueFineCirculationRulesEngineResource;
import org.folio.circulation.resources.OverdueFineScheduledNoticeProcessingResource;
import org.folio.circulation.resources.PickSlipsResource;
import org.folio.circulation.resources.PrintEventsResource;
import org.folio.circulation.resources.RequestByInstanceIdResource;
import org.folio.circulation.resources.RequestCirculationRulesEngineResource;
import org.folio.circulation.resources.RequestCollectionResource;
Expand Down Expand Up @@ -154,6 +155,7 @@ public void start(Promise<Void> startFuture) {
new LoanRelatedFeeFineClosedHandlerResource(client).register(router);
new FeeFineBalanceChangedHandlerResource(client).register(router);
new CirculationSettingsResource(client).register(router);
new PrintEventsResource(client).register(router);

server.requestHandler(router)
.listen(config().getInteger("port"), result -> {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/folio/circulation/domain/Campus.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public static Campus unknown() {
}

public static Campus unknown(String id) {
return new Campus(id, null);
return new Campus(id, null, null);
}

String id;
String name;
String code;
}
3 changes: 2 additions & 1 deletion src/main/java/org/folio/circulation/domain/Holdings.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Value
public class Holdings {
public static Holdings unknown(String id) {
return new Holdings(id, null, null, null);
return new Holdings(id, null, null, null, null);
}

public static Holdings unknown() {
Expand All @@ -16,4 +16,5 @@ public static Holdings unknown() {
String instanceId;
String copyNumber;
String permanentLocationId;
String effectiveLocationId;
}
3 changes: 2 additions & 1 deletion src/main/java/org/folio/circulation/domain/Institution.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public static Institution unknown() {
}

public static Institution unknown(String id) {
return new Institution(id, null);
return new Institution(id, null, null);
}

String id;
String name;
String code;
}
8 changes: 8 additions & 0 deletions src/main/java/org/folio/circulation/domain/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,12 @@ public Item changeTenantId(String tenantId) {
}
return this;
}

public boolean isAtLocation(String locationCode) {
return locationCode != null && getLocation() != null && (
locationCode.equals(getLocation().getCode()) ||
locationCode.equals(getLocation().getLibrary().getCode()) ||
locationCode.equals(getLocation().getCampus().getCode()) ||
locationCode.equals(getLocation().getInstitution().getCode()));
}
}
3 changes: 2 additions & 1 deletion src/main/java/org/folio/circulation/domain/Library.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public static Library unknown() {
}

public static Library unknown(String id) {
return new Library(id, null);
return new Library(id, null, null);
}

String id;
String name;
String code;
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ private void additionalBorrowerProperties(JsonObject loanRepresentation, User bo
borrowerSummary.put("lastName", borrower.getLastName());
borrowerSummary.put("middleName", borrower.getMiddleName());
borrowerSummary.put("barcode", borrower.getBarcode());

borrowerSummary.put("preferredFirstName",borrower.getPreferredFirstName());
borrowerSummary.put("patronGroup",borrower.getPatronGroupId());
loanRepresentation.put(BORROWER, borrowerSummary);

additionalPatronGroupProperties(loanRepresentation, borrower.getPatronGroup());
}

Expand Down
Loading

0 comments on commit afcd021

Please sign in to comment.