-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MODINV-1029] Declare an interface to update ownership of Holdings an…
…d Items
- Loading branch information
1 parent
0ecb85a
commit 27243af
Showing
15 changed files
with
598 additions
and
31 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,28 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Ids holder for updating ownership of the holdings records", | ||
"type": "object", | ||
"properties": { | ||
"toInstanceId": { | ||
"description": "Id of the instance which contains holdings to update ownership.", | ||
"$ref": "uuid.json" | ||
}, | ||
"holdingsRecordIds": { | ||
"description": "Ids of the holdings to update ownership.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "uuid.json" | ||
} | ||
}, | ||
"targetTenantId": { | ||
"description": "Id of the tenant to update ownership.", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"toInstanceId", | ||
"holdingsRecordIds", | ||
"targetTenantId" | ||
] | ||
} |
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,66 @@ | ||
#%RAML 1.0 | ||
title: Inventory Update Ownership API | ||
version: v0.1 | ||
protocols: [ HTTP, HTTPS ] | ||
baseUri: http://localhost | ||
|
||
documentation: | ||
- title: "Inventory Update Ownership API" | ||
content: <b>API for updating ownership of holdings records and items between ECS tenants</b> | ||
|
||
types: | ||
errors: !include raml-util/schemas/errors.schema | ||
items_update_ownership: !include items_update_ownership.json | ||
holdings_update_ownership: !include holdings_update_ownership.json | ||
move_response: !include move_response.json | ||
|
||
traits: | ||
language: !include raml-util/traits/language.raml | ||
validate: !include raml-util/traits/validation.raml | ||
|
||
/inventory/items/update-ownership: | ||
displayName: Items Update Ownership | ||
post: | ||
is: [validate] | ||
body: | ||
application/json: | ||
type: items_update_ownership | ||
responses: | ||
200: | ||
description: "Items ownership updated to another tenant" | ||
body: | ||
application/json: | ||
type: move_response | ||
422: | ||
description: "Validation error" | ||
body: | ||
application/json: | ||
type: errors | ||
500: | ||
description: "Internal server error" | ||
body: | ||
text/plain: | ||
example: "Internal server error" | ||
/inventory/holdings/update-ownership: | ||
displayName: Holdings Record Update Ownership | ||
post: | ||
is: [validate] | ||
body: | ||
application/json: | ||
type: holdings_update_ownership | ||
responses: | ||
200: | ||
description: "Holdings record ownership updated to another tenant" | ||
body: | ||
application/json: | ||
type: move_response | ||
422: | ||
description: "Validation error" | ||
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Ids holder for updating ownership of the items", | ||
"type": "object", | ||
"properties": { | ||
"toHoldingsRecordId": { | ||
"description": "Id of the holding to which the items are updating ownership.", | ||
"$ref": "uuid.json" | ||
}, | ||
"itemIds": { | ||
"description": "Ids of the items to update ownership.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "uuid.json" | ||
} | ||
}, | ||
"targetTenantId": { | ||
"description": "Id of the tenant to update ownership.", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"toHoldingsRecordId", | ||
"itemIds", | ||
"targetTenantId" | ||
] | ||
} |
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
28 changes: 28 additions & 0 deletions
28
src/main/java/org/folio/inventory/resources/UpdateOwnershipApi.java
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 @@ | ||
package org.folio.inventory.resources; | ||
|
||
import io.vertx.core.http.HttpClient; | ||
import io.vertx.ext.web.Router; | ||
import io.vertx.ext.web.RoutingContext; | ||
import org.folio.inventory.storage.Storage; | ||
|
||
public class UpdateOwnershipApi extends AbstractInventoryResource { | ||
public UpdateOwnershipApi(Storage storage, HttpClient client) { | ||
super(storage, client); | ||
} | ||
|
||
@Override | ||
public void register(Router router) { | ||
router.post("/inventory/items/update-ownership") | ||
.handler(this::updateItemsOwnership); | ||
router.post("/inventory/holdings/update-ownership") | ||
.handler(this::updateHoldingsOwnership); | ||
} | ||
|
||
private void updateHoldingsOwnership(RoutingContext routingContext) { | ||
|
||
} | ||
|
||
private void updateItemsOwnership(RoutingContext routingContext) { | ||
|
||
} | ||
} |
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
Oops, something went wrong.