-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/master' into ecs-tlr-feature
# Conflicts: # src/main/java/org/folio/service/CirculationSettingsService.java # src/test/java/org/folio/rest/api/CirculationSettingsAPITest.java
- Loading branch information
Showing
23 changed files
with
775 additions
and
40 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
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" | ||
} |
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,6 @@ | ||
{ | ||
"requestIds" : [ | ||
"fbbbe691-d6c6-4f40-b9dd-7364ccb1518a", | ||
"fd831be3-f05f-4b6f-b68f-1a976ea1ab0f" | ||
] | ||
} |
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,7 @@ | ||
{ | ||
"requestId": "fbbbe691-d6c6-4f40-b9dd-7364ccb1518a", | ||
"requesterId": "44642483-f4d4-4a29-a2ba-8eefcf53de16", | ||
"requesterName": "vignesh", | ||
"count": 2, | ||
"printEventDate": "2024-07-04T07:07:00.000+00:00" | ||
} |
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,19 @@ | ||
{ | ||
"printEventsStatusResponses": [ | ||
{ | ||
"requestId": "fbbbe691-d6c6-4f40-b9dd-7364ccb1518a", | ||
"requesterId": "44642483-f4d4-4a29-a2ba-8eefcf53de16", | ||
"requesterName": "vignesh", | ||
"count": 2, | ||
"printEventDate": "2024-07-04T07:07:00.000+00:00" | ||
}, | ||
{ | ||
"requestId": "fd831be3-f05f-4b6f-b68f-1a976ea1ab0f", | ||
"requesterId": "44642483-f4d4-4a29-a2ba-8eefcf53de17", | ||
"requesterName": "siddhu", | ||
"count": 5, | ||
"printEventDate": "2024-07-05T07:07:00.000+00:00" | ||
} | ||
], | ||
"totalRecords": 2 | ||
} |
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,38 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Print Events Request", | ||
"type": "object", | ||
"properties": { | ||
"requestIds": { | ||
"description": "List of request IDs", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" | ||
} | ||
}, | ||
"requesterId": { | ||
"description": "ID of the requester", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema", | ||
"pattern": "^(?!\\s*$).+" | ||
}, | ||
"requesterName": { | ||
"description": "Name of the requester", | ||
"type": "string", | ||
"pattern": "^(?!\\s*$).+" | ||
}, | ||
"printEventDate": { | ||
"description": "Date and time when the print command is executed", | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
}, | ||
"required": [ | ||
"requestIds", | ||
"requesterId", | ||
"requesterName", | ||
"printEventDate" | ||
] | ||
} |
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,17 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Print Events Request", | ||
"type": "object", | ||
"properties": { | ||
"requestIds": { | ||
"description": "List of request IDs", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" | ||
} | ||
} | ||
} | ||
} | ||
|
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,28 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Print events details", | ||
"type": "object", | ||
"properties": { | ||
"requestId": { | ||
"description": "ID of the request", | ||
"type": "string" | ||
}, | ||
"requesterId": { | ||
"description": "ID of the requester", | ||
"type": "string" | ||
}, | ||
"requesterName": { | ||
"description": "Name of the requester", | ||
"type": "string" | ||
}, | ||
"count": { | ||
"description": "No of times the request is printed", | ||
"type": "integer" | ||
}, | ||
"printEventDate": { | ||
"description": "Date and time when the print command is executed", | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
} | ||
} |
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,23 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Collection of print events details", | ||
"type": "object", | ||
"properties": { | ||
"printEventsStatusResponses": { | ||
"description": "List of print events details", | ||
"id": "printEvents", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "print-events-status-response.json" | ||
} | ||
}, | ||
"totalRecords": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"printEventsStatusResponses", | ||
"totalRecords" | ||
] | ||
} |
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,73 @@ | ||
#%RAML 1.0 | ||
title: Print Events Storage | ||
version: v1.0 | ||
protocols: [ HTTP, HTTPS ] | ||
baseUri: http://localhost:9130 | ||
|
||
documentation: | ||
- title: Print Events Storage API | ||
content: <b>Storage for print events</b> | ||
|
||
types: | ||
print-events-request: !include print-events-request.json | ||
print-events-status-request: !include print-events-status-request.json | ||
print-events-status-responses: !include print-events-status-responses.json | ||
errors: !include raml-util/schemas/errors.schema | ||
|
||
traits: | ||
validate: !include raml-util/traits/validation.raml | ||
|
||
/print-events-storage: | ||
/print-events-entry: | ||
post: | ||
is: [validate] | ||
description: save a print event log | ||
body: | ||
application/json: | ||
type: print-events-request | ||
responses: | ||
201: | ||
description: "All items have been successfully created or updated" | ||
409: | ||
description: "Optimistic locking version conflict" | ||
body: | ||
text/plain: | ||
example: "Version error" | ||
413: | ||
description: "Payload too large" | ||
body: | ||
text/plain: | ||
example: "Payload too large" | ||
422: | ||
description: "Unprocessable entity" | ||
body: | ||
application/json: | ||
type: errors | ||
500: | ||
description: "Internal server error" | ||
body: | ||
text/plain: | ||
example: "Internal server error" | ||
/print-events-status: | ||
post: | ||
is: [validate] | ||
description: Fetch batch of print event details | ||
body: | ||
application/json: | ||
type: print-events-status-request | ||
responses: | ||
200: | ||
description: "Requests print event details are successfully retreived" | ||
body: | ||
application/json: | ||
type: print-events-status-responses | ||
422: | ||
description: "Unprocessable entity" | ||
body: | ||
application/json: | ||
type: errors | ||
500: | ||
description: "Internal server error" | ||
body: | ||
text/plain: | ||
example: "Internal server error" |
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 |
---|---|---|
|
@@ -123,4 +123,4 @@ public Future<RowSet<Row>> deleteById(String id) { | |
return postgresClient.delete(tableName, id); | ||
} | ||
|
||
} | ||
} |
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,37 @@ | ||
package org.folio.rest.impl; | ||
|
||
import io.vertx.core.AsyncResult; | ||
import io.vertx.core.Context; | ||
import io.vertx.core.Handler; | ||
import org.folio.rest.jaxrs.model.PrintEventsRequest; | ||
import org.folio.rest.jaxrs.model.PrintEventsStatusRequest; | ||
import org.folio.rest.jaxrs.resource.PrintEventsStorage; | ||
import org.folio.service.PrintEventsService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.ws.rs.core.Response; | ||
import java.util.Map; | ||
|
||
import static io.vertx.core.Future.succeededFuture; | ||
|
||
public class PrintEventsApi implements PrintEventsStorage { | ||
private static final Logger LOG = LoggerFactory.getLogger(PrintEventsApi.class); | ||
|
||
@Override | ||
public void postPrintEventsStoragePrintEventsEntry(PrintEventsRequest printEventsRequest, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) { | ||
LOG.info("postPrintEventsStoragePrintEvents:: save print events {}", printEventsRequest); | ||
new PrintEventsService(vertxContext, okapiHeaders) | ||
.create(printEventsRequest) | ||
.onSuccess(response -> asyncResultHandler.handle(succeededFuture(response))) | ||
.onFailure(throwable -> asyncResultHandler.handle(succeededFuture(PostPrintEventsStoragePrintEventsEntryResponse.respond500WithTextPlain(throwable.getMessage())))); | ||
} | ||
|
||
@Override | ||
public void postPrintEventsStoragePrintEventsStatus(PrintEventsStatusRequest entity, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) { | ||
LOG.info("postPrintEventsStoragePrintEventsStatus:: Fetching print event details for requestIds {}", | ||
entity.getRequestIds()); | ||
new PrintEventsService(vertxContext, okapiHeaders) | ||
.getPrintEventRequestDetails(entity.getRequestIds(), asyncResultHandler); | ||
} | ||
} |
Oops, something went wrong.