-
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.
CIRCSTORE-540: ItemUpdateProcessorForRequest update item's location a…
…nd SP
- Loading branch information
1 parent
2e439a7
commit 7a5fd74
Showing
7 changed files
with
209 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "A (shelf) location, the forth-level location unit below institution, campus, and library.", | ||
"javaType": "org.folio.rest.jaxrs.model.Location", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"description": "id of this (shelf) location record as UUID.", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"description": "Name of the (shelf) location", | ||
"type": "string" | ||
}, | ||
"code": { | ||
"description": "Code of the (shelf) location, usually an abbreviation of the name.", | ||
"type": "string" | ||
}, | ||
"description": { | ||
"description": "Description of the (shelf) location.", | ||
"type": "string" | ||
}, | ||
"discoveryDisplayName": { | ||
"description": "Name of the (shelf) location to be shown in the discovery.", | ||
"type": "string" | ||
}, | ||
"isActive": { | ||
"description": "Whether this (shelf) location is active. Inactive (shelf) locations can no longer been used.", | ||
"type": "boolean" | ||
}, | ||
"institutionId": { | ||
"description": "The UUID of the institution, the first-level location unit, this (shelf) location belongs to.", | ||
"type": "string" | ||
}, | ||
"campusId": { | ||
"description": "The UUID of the campus, the second-level location unit, this (shelf) location belongs to.", | ||
"type": "string" | ||
}, | ||
"libraryId": { | ||
"description": "The UUID of the library, the third-level location unit, this (shelf) location belongs to.", | ||
"type": "string" | ||
}, | ||
"primaryServicePoint": { | ||
"description": "The UUID of the primary service point of this (shelf) location.", | ||
"format": "uuid", | ||
"type": "string" | ||
}, | ||
"servicePointIds": { | ||
"description": "All service points that this (shelf) location has.", | ||
"type": "array", | ||
"items": { | ||
"description": "The UUID of a service point that belongs to this (shelf) location.", | ||
"type": "string", | ||
"format": "uuid", | ||
"not": { | ||
"type": "null" | ||
} | ||
} | ||
}, | ||
"metadata": { | ||
"type": "object", | ||
"$ref": "../raml-util/schemas/metadata.schema", | ||
"readonly": true | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"name", | ||
"code", | ||
"institutionId", | ||
"campusId", | ||
"libraryId", | ||
"primaryServicePoint" | ||
] | ||
} |
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,24 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "List of (shelf) locations.", | ||
"type": "object", | ||
"properties": { | ||
"locations": { | ||
"id": "locations", | ||
"description": "List of (shelf) locations.", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "location.json" | ||
} | ||
}, | ||
"totalRecords": { | ||
"description": "Estimated or exact total number of records", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"locations", | ||
"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
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
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
30 changes: 30 additions & 0 deletions
30
src/test/java/org/folio/rest/support/builders/LocationBuilder.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,30 @@ | ||
package org.folio.rest.support.builders; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import lombok.AllArgsConstructor; | ||
import lombok.With; | ||
|
||
import java.util.UUID; | ||
|
||
@With | ||
@AllArgsConstructor | ||
public class LocationBuilder extends JsonBuilder implements Builder { | ||
private final String id; | ||
private final String name; | ||
private final String code; | ||
private final String primaryServicePoint; | ||
|
||
public LocationBuilder(String name) { | ||
this(UUID.randomUUID().toString(), name, null, null); | ||
} | ||
|
||
@Override | ||
public JsonObject create() { | ||
JsonObject location = new JsonObject(); | ||
put(location, "id", this.id); | ||
put(location, "name", this.name); | ||
put(location, "code", this.code); | ||
put(location, "primaryServicePoint", this.primaryServicePoint); | ||
return location; | ||
} | ||
} |