diff --git a/NEWS.md b/NEWS.md
index 941036d78..0cd9808dc 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -20,6 +20,7 @@
### Features
* Add module descriptor validator plugin and fix the permission names ([MODINVSTOR-1247](https://folio-org.atlassian.net/browse/MODINVSTOR-1247))
+* Implement publication period migration on big dataset, create new InstanceWithoutPubPeriod schema for request/response API ([MODINVSTOR-1271](https://folio-org.atlassian.net/browse/MODINVSTOR-1271))
### Tech Dept
* Upgrade localstack from 0.11.3 to s3-latest (=3.8.0) ([MODINVSTOR-1272](https://folio-org.atlassian.net/browse/MODINVSTOR-1272))
diff --git a/pom.xml b/pom.xml
index 8916b130d..1ec2a210b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,6 +23,7 @@
3.17.0
2.24.1
2.2.0-SNAPSHOT
+ 2.11.0
6.0.3
5.11.2
@@ -138,6 +139,11 @@
folio-s3-client
${folio-s3-client.version}
+
+ com.google.code.gson
+ gson
+ ${google-code-gson.version}
+
diff --git a/ramls/dereferenceditem-without-pub-period.json b/ramls/dereferenceditem-without-pub-period.json
new file mode 100644
index 000000000..58b6789ac
--- /dev/null
+++ b/ramls/dereferenceditem-without-pub-period.json
@@ -0,0 +1,416 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "An item record with related record data",
+ "type": "object",
+ "javaType": "org.folio.rest.jaxrs.model.DereferencedItemWithoutPubPeriod",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique ID of the item record"
+ },
+ "instanceRecord":{
+ "type": "object",
+ "description" : "Parent instance record without the publicationPeriod.",
+ "$ref": "instance-without-pub-period.json"
+ },
+ "_version": {
+ "type": "integer",
+ "description": "Record version for optimistic locking"
+ },
+ "hrid": {
+ "type": "string",
+ "description": "The human readable ID, also called eye readable ID. A system-assigned sequential alternate ID"
+ },
+ "holdingsRecord": {
+ "type": "object",
+ "description": "Holdings record the item is a member of.",
+ "$ref": "holdings-storage/holdingsRecord.json"
+ },
+ "formerIds": {
+ "type": "array",
+ "description": "Previous identifiers assigned to the item",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "discoverySuppress": {
+ "type": "boolean",
+ "description": "Records the fact that the record should not be displayed in a discovery system"
+ },
+ "accessionNumber": {
+ "type": "string",
+ "description": "Also called inventar number"
+ },
+ "barcode": {
+ "type": "string",
+ "description": "Unique inventory control number for physical resources, used largely for circulation purposes"
+ },
+ "effectiveShelvingOrder": {
+ "type": "string",
+ "description": "A system generated normalization of the call number that allows for call number sorting in reports and search results",
+ "readonly": true
+ },
+ "itemLevelCallNumber": {
+ "type": "string",
+ "description": "Call Number is an identifier assigned to an item, usually printed on a label attached to the item. The call number is used to determine the items physical position in a shelving sequence, e.g. K1 .M44. The Item level call number, is the call number on item level."
+ },
+ "itemLevelCallNumberPrefix": {
+ "type": "string",
+ "description": "Prefix of the call number on the item level."
+ },
+ "itemLevelCallNumberSuffix": {
+ "type": "string",
+ "description": "Suffix of the call number on the item level."
+ },
+ "itemLevelCallNumberTypeId": {
+ "type": "string",
+ "description": "Identifies the source of the call number, e.g., LCC, Dewey, NLM, etc."
+ },
+ "effectiveCallNumberComponents": {
+ "type": "object",
+ "description": "Elements of a full call number generated from the item or holding",
+ "properties": {
+ "callNumber": {
+ "type": "string",
+ "description": "Effective Call Number is an identifier assigned to an item or its holding and associated with the item.",
+ "readonly": true
+ },
+ "prefix": {
+ "type": "string",
+ "description": "Effective Call Number Prefix is the prefix of the identifier assigned to an item or its holding and associated with the item.",
+ "readonly": true
+ },
+ "suffix": {
+ "type": "string",
+ "description": "Effective Call Number Suffix is the suffix of the identifier assigned to an item or its holding and associated with the item.",
+ "readonly": true
+ },
+ "typeId": {
+ "type": "string",
+ "description": "Effective Call Number Type Id is the call number type id of the item, if available, otherwise that of the holding.",
+ "$ref": "uuid.json",
+ "readonly": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "volume": {
+ "type": "string",
+ "description": "Volume is intended for monographs when a multipart monograph (e.g. a biography of George Bernard Shaw in three volumes)."
+ },
+ "enumeration": {
+ "type": "string",
+ "description": "Enumeration is the descriptive information for the numbering scheme of a serial."
+ },
+ "chronology": {
+ "type": "string",
+ "description": "Chronology is the descriptive information for the dating scheme of a serial."
+ },
+ "yearCaption": {
+ "type": "array",
+ "description": "In multipart monographs, a caption is a character(s) used to label a level of chronology, e.g., year 1985.",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "itemIdentifier": {
+ "type": "string",
+ "description": "Item identifier number, e.g. imported from the union catalogue (read only)."
+ },
+ "copyNumber": {
+ "type": "string",
+ "description": "Copy number is the piece identifier. The copy number reflects if the library has a copy of a single-volume monograph; one copy of a multi-volume, (e.g. Copy 1, or C.7.)"
+ },
+ "numberOfPieces": {
+ "type": "string",
+ "description": "Number of pieces. Used when an item is checked out or returned to verify that all parts are present (e.g. 7 CDs in a set)."
+ },
+ "descriptionOfPieces": {
+ "description": "Description of item pieces.",
+ "type": "string"
+ },
+ "numberOfMissingPieces": {
+ "type": "string",
+ "description": "Number of missing pieces."
+ },
+ "missingPieces": {
+ "type": "string",
+ "description": "Description of the missing pieces. "
+ },
+ "missingPiecesDate": {
+ "type": "string",
+ "description": "Date when the piece(s) went missing."
+ },
+ "itemDamagedStatusId": {
+ "description": "Item dame status id identifier.",
+ "type": "string"
+ },
+ "itemDamagedStatusDate": {
+ "description": "Date and time when the item was damaged.",
+ "type": "string"
+ },
+ "administrativeNotes":{
+ "type": "array",
+ "description": "Administrative notes",
+ "minItems": 0,
+ "items": {
+ "type": "string"
+ }
+ },
+ "notes": {
+ "type": "array",
+ "description": "Notes about action, copy, binding etc.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "itemNoteTypeId": {
+ "type": "string",
+ "description": "ID of the type of note"
+ },
+ "itemNoteType": {
+ "description": "Type of item's note",
+ "type": "object",
+ "folio:$ref": "itemnotetype.json",
+ "javaType": "org.folio.rest.jaxrs.model.itemNoteTypeVirtual",
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "item-note-types",
+ "folio:linkFromField": "itemNoteTypeId",
+ "folio:linkToField": "id",
+ "folio:includedElement": "itemNoteTypes.0"
+ },
+ "note": {
+ "type": "string",
+ "description": "Text content of the note"
+ },
+ "staffOnly": {
+ "type": "boolean",
+ "description": "If true, determines that the note should not be visible for others than staff",
+ "default": false
+ }
+ }
+ }
+ },
+ "circulationNotes": {
+ "type": "array",
+ "description": "Notes to be displayed in circulation processes",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The id of the circulation note"
+ },
+ "noteType": {
+ "type": "string",
+ "description": "Type of circulation process that the note applies to",
+ "enum": ["Check in", "Check out"]
+ },
+ "note": {
+ "type": "string",
+ "description": "Text to display"
+ },
+ "source": {
+ "type": "object",
+ "description": "The user who added/updated the note. The property is generated by the server and needed to support sorting. Points to /users/{id} resource.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The id of the user who added/updated the note. The user information is generated by the server and needed to support sorting. Points to /users/{id} resource."
+ },
+ "personal": {
+ "type": "object",
+ "description": "Personal information about the user",
+ "properties": {
+ "lastName": {
+ "description": "The user's last name",
+ "type": "string"
+ },
+ "firstName": {
+ "description": "The user's first name",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "date": {
+ "type": "string",
+ "description": "Date and time the record is added/updated. The property is generated by the server and needed to support sorting."
+ },
+ "staffOnly": {
+ "type": "boolean",
+ "description": "Flag to restrict display of this note",
+ "default": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "status": {
+ "description": "The status of the item",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Name of the status e.g. Available, Checked out, In transit",
+ "type": "string",
+ "enum": [
+ "Aged to lost",
+ "Available",
+ "Awaiting pickup",
+ "Awaiting delivery",
+ "Checked out",
+ "Claimed returned",
+ "Declared lost",
+ "In process",
+ "In process (non-requestable)",
+ "In transit",
+ "Intellectual item",
+ "Long missing",
+ "Lost and paid",
+ "Missing",
+ "On order",
+ "Paged",
+ "Restricted",
+ "Order closed",
+ "Unavailable",
+ "Unknown",
+ "Withdrawn"
+ ]
+ },
+ "date": {
+ "description": "Date and time when the status was last changed",
+ "type": "string",
+ "format": "date-time",
+ "readonly": true
+ }
+ },
+ "required": ["name"],
+ "additionalProperties": false
+ },
+ "materialType": {
+ "description": "Item's material type",
+ "type": "object",
+ "$ref": "materialtype.json"
+ },
+ "permanentLoanType": {
+ "type": "object",
+ "description": "The permanent loan type, is the default loan type for a given item. Loan types are tenant-defined.",
+ "$ref":"loantype.json"
+ },
+ "temporaryLoanType": {
+ "type": "object",
+ "description": "Temporary loan type, is the temporary loan type for a given item.",
+ "$ref":"loantype.json"
+ },
+ "permanentLocation": {
+ "type": "object",
+ "description": "Permanent item location is the default location, shelving location, or holding which is a physical place where items are stored, or an Online location.",
+ "$ref": "locations/location.json"
+ },
+ "temporaryLocation": {
+ "type": "object",
+ "description": "Temporary item location is the temporarily location, shelving location, or holding which is a physical place where items are stored, or an Online location.",
+ "$ref": "locations/location.json"
+ },
+ "effectiveLocation": {
+ "type": "object",
+ "description": "Read only current home location for the item.",
+ "$ref": "locations/location.json",
+ "readonly": true
+ },
+ "electronicAccess": {
+ "type": "array",
+ "description": "References for accessing the item by URL.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "uri": {
+ "type": "string",
+ "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources"
+ },
+ "linkText": {
+ "type": "string",
+ "description": "the value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated"
+ },
+ "materialsSpecification": {
+ "type": "string",
+ "description": "materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)"
+ },
+ "publicNote": {
+ "type": "string",
+ "description": "URL public note to be displayed in the discovery"
+ },
+ "relationshipId": {
+ "type": "string",
+ "description": "relationship between the electronic resource at the location identified and the item described in the record as a whole"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "uri"
+ ]
+ }
+ },
+ "inTransitDestinationServicePointId": {
+ "description": "Service point an item is intended to be transited to (should only be present when in transit)",
+ "type": "string",
+ "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
+ },
+ "statisticalCodeIds": {
+ "type": "array",
+ "description": "List of statistical code IDs",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "purchaseOrderLineIdentifier": {
+ "type": "string",
+ "description": "ID referencing a remote purchase order object related to this item"
+ },
+ "tags": {
+ "description": "arbitrary tags associated with this item",
+ "id": "tags",
+ "type": "object",
+ "$ref": "raml-util/schemas/tags.schema"
+ },
+ "metadata": {
+ "type": "object",
+ "$ref": "raml-util/schemas/metadata.schema",
+ "readonly": true
+ },
+ "lastCheckIn": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "Information about when an item was last scanned in the Inventory app.",
+ "properties": {
+ "dateTime": {
+ "type": "string",
+ "description": "Date and time of the last check in of the item.",
+ "format": "date-time"
+ },
+ "servicePointId": {
+ "type": "string",
+ "description": "Service point ID being used by a staff member when item was scanned in Check in app.",
+ "$ref": "uuid.json"
+ },
+ "staffMemberId": {
+ "type": "string",
+ "description": "ID a staff member who scanned the item",
+ "$ref": "uuid.json"
+ }
+ }
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "materialType",
+ "instanceRecord",
+ "permanentLoanType",
+ "holdingsRecord",
+ "status"
+ ]
+}
diff --git a/ramls/dereferenceditems-without-pub-period.json b/ramls/dereferenceditems-without-pub-period.json
new file mode 100644
index 000000000..bf5365257
--- /dev/null
+++ b/ramls/dereferenceditems-without-pub-period.json
@@ -0,0 +1,24 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "A collection of dereferenced item records",
+ "type": "object",
+ "properties": {
+ "dereferencedItems": {
+ "description": "List of dereferenced item records",
+ "id": "items",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "$ref": "dereferenceditem-without-pub-period.json"
+ }
+ },
+ "totalRecords": {
+ "description": "Estimated or exact total number of records",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "dereferencedItems",
+ "totalRecords"
+ ]
+}
diff --git a/ramls/instance-set.json b/ramls/instance-set.json
index c60c480a3..7d375ab2e 100644
--- a/ramls/instance-set.json
+++ b/ramls/instance-set.json
@@ -8,8 +8,8 @@
"$ref": "uuid.json"
},
"instance": {
- "description": "Instance record",
- "$ref": "instance.json"
+ "description": "Instance record without the publicationPeriod",
+ "$ref": "instance-without-pub-period.json"
},
"holdingsRecords": {
"type": "array",
diff --git a/ramls/instance-storage-batch.raml b/ramls/instance-storage-batch.raml
index b28f3fc2a..d06642820 100644
--- a/ramls/instance-storage-batch.raml
+++ b/ramls/instance-storage-batch.raml
@@ -11,6 +11,7 @@ documentation:
types:
errors: !include raml-util/schemas/errors.schema
instances: !include instances.json
+ instancesWithoutPubPeriod: !include instances-without-pub-period.json
instancesBatchResponse: !include instances-batch-response.json
/instance-storage/batch/instances:
@@ -19,7 +20,7 @@ types:
description: "Create collection of instances in one request - deprecated, use /instance-storage/sync instead"
body:
application/json:
- type: instances
+ type: instancesWithoutPubPeriod
responses:
201:
description: "At least one Instance from the list was created"
diff --git a/ramls/instance-storage.raml b/ramls/instance-storage.raml
index 373a5785b..42e16acfc 100644
--- a/ramls/instance-storage.raml
+++ b/ramls/instance-storage.raml
@@ -9,6 +9,8 @@ documentation:
content: Storage for instances in the inventory
types:
+ instanceWithoutPubPeriod: !include instance-without-pub-period.json
+ instancesWithoutPubPeriod: !include instances-without-pub-period.json
instance: !include instance.json
instances: !include instances.json
marcJson: !include marc.json
@@ -61,8 +63,8 @@ resourceTypes:
type:
collection:
exampleCollection: !include examples/instances_get.json
- schemaCollection: instances
- schemaItem: instance
+ schemaCollection: instancesWithoutPubPeriod
+ schemaItem: instanceWithoutPubPeriod
exampleItem: !include examples/instance_get.json
get:
is: [pageable,
@@ -90,13 +92,13 @@ resourceTypes:
type:
collection-item:
exampleItem: !include examples/instance_get.json
- schema: instance
+ schema: instanceWithoutPubPeriod
get:
responses:
200:
body:
application/json:
- type: instance
+ type: instanceWithoutPubPeriod
description: |
Get Instance by InstanceId
Instances are stored and accessed by a hash of key properties. The rules which govern
diff --git a/ramls/instance-without-pub-period.json b/ramls/instance-without-pub-period.json
new file mode 100644
index 000000000..b6542c778
--- /dev/null
+++ b/ramls/instance-without-pub-period.json
@@ -0,0 +1,508 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "An instance record without publicationPeriod",
+ "type": "object",
+ "javaType": "org.folio.rest.jaxrs.model.InstanceWithoutPubPeriod",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the instance record; a UUID",
+ "$ref": "uuid.json"
+ },
+ "_version": {
+ "type": "integer",
+ "description": "Record version for optimistic locking"
+ },
+ "hrid": {
+ "type": "string",
+ "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
+ },
+ "matchKey": {
+ "type": "string",
+ "description" : "A unique instance identifier matching a client-side bibliographic record identification scheme, in particular for a scenario where multiple separate catalogs with no shared record identifiers contribute to the same Instance in Inventory. A match key is typically generated from select, normalized pieces of metadata in bibliographic records"
+ },
+ "source": {
+ "type": "string",
+ "description": "The metadata source and its format of the underlying record to the instance record. (e.g. FOLIO if it's a record created in Inventory; MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings; CONSORTIUM-MARC or CONSORTIUM-FOLIO for sharing Instances)."
+ },
+ "title": {
+ "type": "string",
+ "description": "The primary title (or label) associated with the resource"
+ },
+ "indexTitle": {
+ "type": "string",
+ "description": "Title normalized for browsing and searching; based on the title with articles removed"
+ },
+ "alternativeTitles": {
+ "type": "array",
+ "description": "List of alternative titles for the resource (e.g. original language version title of a movie)",
+ "items": {
+ "type": "object",
+ "properties": {
+ "alternativeTitleTypeId": {
+ "type": "string",
+ "description": "UUID for an alternative title qualifier",
+ "$ref": "uuid.json"
+ },
+ "alternativeTitle": {
+ "type": "string",
+ "description": "An alternative title for the resource"
+ },
+ "authorityId": {
+ "type": "string",
+ "description": "UUID of authority record that controls an alternative title",
+ "$ref": "uuid.json"
+ }
+ }
+ },
+ "uniqueItems": true
+ },
+ "editions": {
+ "type": "array",
+ "description": "The edition statement, imprint and other publication source information",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "series": {
+ "type": "array",
+ "description": "List of series titles associated with the resource (e.g. Harry Potter)",
+ "items": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "Series title value"
+ },
+ "authorityId": {
+ "type": "string",
+ "description": "UUID of authority record that controls an series title",
+ "$ref": "uuid.json"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "value"
+ ]
+ },
+ "uniqueItems": true
+ },
+ "identifiers": {
+ "type": "array",
+ "description": "An extensible set of name-value pairs of identifiers associated with the resource",
+ "minItems": 0,
+ "items": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "Resource identifier value"
+ },
+ "identifierTypeId": {
+ "type": "string",
+ "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
+ "$ref": "uuid.json"
+ },
+ "identifierTypeObject": {
+ "type": "object",
+ "description": "Information about identifier type, looked up from identifierTypeId",
+ "folio:$ref": "illpolicy.json",
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "identifier-types",
+ "folio:linkFromField": "identifierTypeId",
+ "folio:linkToField": "id",
+ "folio:includedElement": "identifierTypes.0"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "value",
+ "identifierTypeId"
+ ]
+ }
+ },
+ "contributors": {
+ "type": "array",
+ "description": "List of contributors",
+ "minItems": 0,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Personal name, corporate name, meeting name"
+ },
+ "contributorTypeId": {
+ "type": "string",
+ "description": "UUID for the contributor type term defined in controlled vocabulary",
+ "$ref": "uuid.json"
+ },
+ "contributorTypeText": {
+ "type": "string",
+ "description": "Free text element for adding contributor type terms other that defined by the MARC code list for relators"
+ },
+ "contributorNameTypeId": {
+ "type": "string",
+ "description": "UUID of contributor name type term defined by the MARC code list for relators",
+ "$ref": "uuid.json"
+ },
+ "authorityId": {
+ "type": "string",
+ "description": "UUID of authority record that controls the contributor",
+ "$ref": "uuid.json"
+ },
+ "contributorNameType": {
+ "type": "object",
+ "description": "Dereferenced contributor-name type",
+ "javaType": "org.folio.rest.jaxrs.model.contributorNameTypeVirtual",
+ "folio:$ref": "contributornametype.json",
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "contributor-name-types",
+ "folio:linkFromField": "contributorNameTypeId",
+ "folio:linkToField": "id",
+ "folio:includedElement": "contributorNameTypes.0"
+ },
+ "primary": {
+ "type": "boolean",
+ "description": "Whether this is the primary contributor"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "name",
+ "contributorNameTypeId"
+ ]
+ }
+ },
+ "subjects": {
+ "type": "array",
+ "description": "List of subject headings",
+ "items": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "Subject heading value"
+ },
+ "authorityId": {
+ "type": "string",
+ "description": "UUID of authority record that controls a subject heading",
+ "$ref": "uuid.json"
+ },
+ "sourceId": {
+ "type": "string",
+ "description": "UUID of subject source",
+ "$ref": "uuid.json"
+ },
+ "typeId": {
+ "type": "string",
+ "description": "UUID of subject type",
+ "$ref": "uuid.json"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "value"
+ ]
+ },
+ "uniqueItems": true
+ },
+ "classifications": {
+ "type": "array",
+ "description": "List of classifications",
+ "minItems": 0,
+ "items": {
+ "type": "object",
+ "properties": {
+ "classificationNumber": {
+ "type": "string",
+ "description": "Classification (e.g. classification scheme, classification schedule)"
+ },
+ "classificationTypeId": {
+ "type": "string",
+ "description": "UUID of classification schema (e.g. LC, Canadian Classification, NLM, National Agricultural Library, UDC, and Dewey)",
+ "$ref": "uuid.json"
+ },
+ "classificationType": {
+ "type": "object",
+ "description": "Dereferenced classification schema",
+ "javaType": "org.folio.rest.jaxrs.model.classificationTypeVirtual",
+ "folio:$ref": "classificationtype.json",
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "classification-types",
+ "folio:linkFromField": "classificationTypeId",
+ "folio:linkToField": "id",
+ "folio:includedElement": "classificationTypes.0"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "classificationNumber",
+ "classificationTypeId"
+ ]
+ }
+ },
+ "publication": {
+ "type": "array",
+ "description": "List of publication items",
+ "items": {
+ "type": "object",
+ "properties": {
+ "publisher": {
+ "type": "string",
+ "description": "Name of publisher, distributor, etc."
+ },
+ "place": {
+ "type": "string",
+ "description": "Place of publication, distribution, etc."
+ },
+ "dateOfPublication": {
+ "type": "string",
+ "description": "Date (year YYYY) of publication, distribution, etc."
+ },
+ "role": {
+ "type": "string",
+ "description": "The role of the publisher, distributor, etc."
+ }
+ }
+ }
+ },
+ "publicationFrequency": {
+ "type": "array",
+ "description": "List of intervals at which a serial appears (e.g. daily, weekly, monthly, quarterly, etc.)",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "publicationRange": {
+ "type": "array",
+ "description": "The range of sequential designation/chronology of publication, or date range",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "electronicAccess": {
+ "type": "array",
+ "description": "List of electronic access items",
+ "items": {
+ "type": "object",
+ "properties": {
+ "uri": {
+ "type": "string",
+ "description": "uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources"
+ },
+ "linkText": {
+ "type": "string",
+ "description": "The value of the MARC tag field 856 2nd indicator, where the values are: no information provided, resource, version of resource, related resource, no display constant generated"
+ },
+ "materialsSpecification": {
+ "type": "string",
+ "description": "Materials specified is used to specify to what portion or aspect of the resource the electronic location and access information applies (e.g. a portion or subset of the item is electronic, or a related electronic resource is being linked to the record)"
+ },
+ "publicNote": {
+ "type": "string",
+ "description": "URL public note to be displayed in the discovery"
+ },
+ "relationshipId": {
+ "type": "string",
+ "description": "UUID for the type of relationship between the electronic resource at the location identified and the item described in the record as a whole",
+ "$ref": "uuid.json"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "uri"
+ ]
+ }
+ },
+ "dates": {
+ "type": "object",
+ "description": "Instance Dates",
+ "properties": {
+ "dateTypeId": {
+ "type": "string",
+ "description": "Date type ID",
+ "$ref": "uuid.json"
+ },
+ "date1": {
+ "type": "string",
+ "description": "Date 1",
+ "maxLength": 4
+ },
+ "date2": {
+ "type": "string",
+ "description": "Date 2",
+ "maxLength": 4
+ }
+ },
+ "additionalProperties": false
+ },
+ "instanceTypeId": {
+ "type": "string",
+ "description": "UUID of the unique term for the resource type whether it's from the RDA content term list of locally defined",
+ "$ref": "uuid.json"
+ },
+ "instanceFormatIds": {
+ "type": "array",
+ "description": "UUIDs for the unique terms for the format whether it's from the RDA carrier term list of locally defined",
+ "items": {
+ "type": "string",
+ "$ref": "uuid.json"
+ }
+ },
+ "instanceFormats": {
+ "type": "array",
+ "description": "List of dereferenced instance formats",
+ "items": {
+ "type": "object",
+ "$ref": "instanceformat.json"
+ },
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "instance-formats",
+ "folio:linkFromField": "instanceFormatIds",
+ "folio:linkToField": "id",
+ "folio:includedElement": "instanceFormats"
+ },
+ "physicalDescriptions": {
+ "type": "array",
+ "description": "Physical description of the described resource, including its extent, dimensions, and such other physical details as a description of any accompanying materials and unit type and size",
+ "items": {
+ "type": "string"
+ }
+ },
+ "languages": {
+ "type": "array",
+ "description": "The set of languages used by the resource",
+ "minItems": 0,
+ "items": {
+ "type": "string"
+ }
+ },
+ "notes": {
+ "type": "array",
+ "description": "Bibliographic notes (e.g. general notes, specialized notes)",
+ "items": {
+ "type": "object",
+ "javaType": "org.folio.rest.jaxrs.model.InstanceNote",
+ "additionalProperties": false,
+ "properties": {
+ "instanceNoteTypeId": {
+ "description": "ID of the type of note",
+ "$ref": "uuid.json"
+ },
+ "note": {
+ "type": "string",
+ "description": "Text content of the note"
+ },
+ "staffOnly": {
+ "type": "boolean",
+ "description": "If true, determines that the note should not be visible for others than staff",
+ "default": false
+ }
+ }
+ }
+ },
+ "administrativeNotes":{
+ "type": "array",
+ "description": "Administrative notes",
+ "minItems": 0,
+ "items": {
+ "type": "string"
+ }
+ },
+ "modeOfIssuanceId": {
+ "type": "string",
+ "description": "UUID of the RDA mode of issuance, a categorization reflecting whether a resource is issued in one or more parts, the way it is updated, and whether its termination is predetermined or not (e.g. monograph, sequential monograph, serial; integrating Resource, other)",
+ "$ref": "uuid.json"
+ },
+ "catalogedDate": {
+ "type": "string",
+ "description": "Date or timestamp on an instance for when is was considered cataloged"
+ },
+ "previouslyHeld": {
+ "type": "boolean",
+ "description": "Records the fact that the resource was previously held by the library for things like Hathi access, etc.",
+ "default": false
+ },
+ "staffSuppress": {
+ "type": "boolean",
+ "description": "Records the fact that the record should not be displayed for others than catalogers"
+ },
+ "discoverySuppress": {
+ "type": "boolean",
+ "description": "Records the fact that the record should not be displayed in a discovery system",
+ "default": false
+ },
+ "statisticalCodeIds": {
+ "type": "array",
+ "description": "List of statistical code IDs",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "sourceRecordFormat": {
+ "type": "string",
+ "description": "Format of the instance source record, if a source record exists (e.g. FOLIO if it's a record created in Inventory, MARC if it's a MARC record created in MARCcat or EPKB if it's a record coming from eHoldings)",
+ "enum": ["MARC-JSON"],
+ "readonly": true
+ },
+ "statusId": {
+ "type": "string",
+ "description": "UUID for the Instance status term (e.g. cataloged, uncatalogued, batch loaded, temporary, other, not yet assigned)",
+ "$ref": "uuid.json"
+ },
+ "statusUpdatedDate": {
+ "type": "string",
+ "description": "Date [or timestamp] for when the instance status was updated"
+ },
+ "tags": {
+ "description": "arbitrary tags associated with this instance",
+ "id": "tags",
+ "type": "object",
+ "$ref": "raml-util/schemas/tags.schema"
+ },
+ "metadata": {
+ "type": "object",
+ "$ref": "raml-util/schemas/metadata.schema",
+ "readonly": true
+ },
+ "holdingsRecords2": {
+ "type": "array",
+ "description": "List of holdings records",
+ "items": {
+ "type": "object",
+ "$ref": "holdings-storage/holdingsRecord.json"
+ },
+ "readonly": true,
+ "folio:isVirtual": true,
+ "folio:linkBase": "holdings-storage/holdings",
+ "folio:linkFromField": "id",
+ "folio:linkToField": "instanceId",
+ "folio:includedElement": "holdingsRecords"
+ },
+ "natureOfContentTermIds": {
+ "type": "array",
+ "description": "Array of UUID for the Instance nature of content (e.g. bibliography, biography, exhibition catalogue, festschrift, newspaper, proceedings, research report, thesis or website)",
+ "uniqueItems": true,
+ "items": {
+ "type": "string",
+ "description": "Single UUID for the Instance nature of content",
+ "$ref": "uuid.json"
+ }
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "source",
+ "title",
+ "instanceTypeId"
+ ]
+}
diff --git a/ramls/instances-batch-response.json b/ramls/instances-batch-response.json
index 93544d1f7..7532b7462 100644
--- a/ramls/instances-batch-response.json
+++ b/ramls/instances-batch-response.json
@@ -5,11 +5,11 @@
"properties": {
"instances": {
"id": "instancesList",
- "description": "List of all successfully saved Instances",
+ "description": "List of all successfully saved Instances without the publicationPeriod",
"type": "array",
"items": {
"type": "object",
- "$ref": "instance.json"
+ "$ref": "instance-without-pub-period.json"
}
},
"errorMessages": {
diff --git a/ramls/instances-without-pub-period.json b/ramls/instances-without-pub-period.json
new file mode 100644
index 000000000..88a0ba224
--- /dev/null
+++ b/ramls/instances-without-pub-period.json
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "A collection of instance records without publicationPeriod",
+ "type": "object",
+ "properties": {
+ "instances": {
+ "description": "List of instance records without publication period",
+ "id": "instances",
+ "type": "array",
+ "items": {
+ "$ref": "instance-without-pub-period.json",
+ "type" : "object"
+ }
+ },
+ "totalRecords": {
+ "description": "Estimated or exact total number of records",
+ "type": "integer"
+ },
+ "resultInfo": {
+ "$ref": "raml-util/schemas/resultInfo.schema",
+ "readonly": true
+ }
+
+ },
+ "required": [
+ "instances",
+ "totalRecords"
+ ]
+}
diff --git a/ramls/instances_post.json b/ramls/instances_post.json
index bb857e514..1eb06e415 100644
--- a/ramls/instances_post.json
+++ b/ramls/instances_post.json
@@ -1,15 +1,15 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
- "description": "A collection of instance records",
+ "description": "A collection of instance records without the publicationPeriod",
"type": "object",
"properties": {
"instances": {
- "description": "List of instance records",
+ "description": "List of instance records without the publicationPeriod",
"id": "instances",
"type": "array",
"items": {
- "type": "object",
- "$ref": "instance.json"
+ "$ref": "instance-without-pub-period.json",
+ "type" : "object"
}
}
},
diff --git a/ramls/inventory-view-instance-without-pub-period.json b/ramls/inventory-view-instance-without-pub-period.json
new file mode 100644
index 000000000..5b02bef83
--- /dev/null
+++ b/ramls/inventory-view-instance-without-pub-period.json
@@ -0,0 +1,35 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Instance with holdings and items",
+ "type": "object",
+ "properties": {
+ "instanceId": {
+ "description": "Instance id",
+ "$ref": "uuid.json"
+ },
+ "isBoundWith": {
+ "description": "Records the relationship between a part of a bound-with (a holdings-record) and the bound-with as a whole (the circulatable item)",
+ "type": "boolean"
+ },
+ "instance": {
+ "description": "Instance record without the publicationPeriod",
+ "$ref": "instance-without-pub-period.json"
+ },
+ "holdingsRecords": {
+ "type": "array",
+ "description": "Holdings records for the instance",
+ "items": {
+ "$ref": "holdings-storage/holdingsRecord.json"
+ }
+ },
+ "items": {
+ "type": "array",
+ "description": "Items for the instance",
+ "items": {
+ "$ref": "item.json"
+ }
+ }
+ },
+ "additionalProperties": false,
+ "required": ["instanceId", "instance"]
+}
diff --git a/ramls/inventory-view.raml b/ramls/inventory-view.raml
index 1d25d5268..59a5fab6d 100644
--- a/ramls/inventory-view.raml
+++ b/ramls/inventory-view.raml
@@ -10,6 +10,7 @@ documentation:
types:
inventoryViewInstance: !include inventory-view-instance.json
+ inventoryViewInstanceWithoutPubPeriod: !include inventory-view-instance-without-pub-period.json
errors: !include raml-util/schemas/errors.schema
traits:
@@ -23,7 +24,7 @@ resourceTypes:
/inventory-view/instances:
type:
collection-stream:
- schemaCollection: inventoryViewInstance
+ schemaCollection: inventoryViewInstanceWithoutPubPeriod
exampleCollection: !include examples/inventory-view-instances.json
get:
description: Get instances by id with their holdings and items
diff --git a/ramls/item-storage-dereferenced.raml b/ramls/item-storage-dereferenced.raml
index ed618e597..1ba83dbad 100644
--- a/ramls/item-storage-dereferenced.raml
+++ b/ramls/item-storage-dereferenced.raml
@@ -11,6 +11,9 @@ documentation:
types:
dereferencedItem: !include dereferenceditem.json
dereferencedItems: !include dereferenceditems.json
+ dereferencedItemWithoutPubPeriod: !include dereferenceditem-without-pub-period.json
+ dereferencedItemsWithoutPubPeriod: !include dereferenceditems-without-pub-period.json
+
errors: !include raml-util/schemas/errors.schema
traits:
@@ -27,7 +30,7 @@ resourceTypes:
type:
collection:
exampleCollection: !include examples/items_dereferenced_get.json
- schemaCollection: dereferencedItems
+ schemaCollection: dereferencedItemsWithoutPubPeriod
get:
is: [pageable,
searchable: {description: "using CQL (indexes for item and material type)",
@@ -37,5 +40,5 @@ resourceTypes:
type:
collection-item:
exampleItem: !include examples/item_dereferenced_get.json
- schema: dereferencedItem
+ schema: dereferencedItemWithoutPubPeriod
get:
diff --git a/src/main/java/org/folio/persist/AbstractRepository.java b/src/main/java/org/folio/persist/AbstractRepository.java
index 5bc276012..077c2551a 100644
--- a/src/main/java/org/folio/persist/AbstractRepository.java
+++ b/src/main/java/org/folio/persist/AbstractRepository.java
@@ -4,24 +4,50 @@
import static io.vertx.core.Promise.promise;
import static java.lang.String.format;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Promise;
+import io.vertx.core.http.HttpHeaders;
+import io.vertx.core.http.HttpServerResponse;
+import io.vertx.core.json.Json;
+import io.vertx.ext.web.RoutingContext;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowSet;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
import java.util.stream.Collectors;
+import javax.ws.rs.core.MediaType;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.folio.HttpStatus;
+import org.folio.cql2pgjson.CQL2PgJSON;
+import org.folio.dbschema.ObjectMapperTool;
+import org.folio.rest.jaxrs.model.Diagnostic;
+import org.folio.rest.jaxrs.model.ResultInfo;
import org.folio.rest.persist.Criteria.Criterion;
+import org.folio.rest.persist.PgExceptionUtil;
import org.folio.rest.persist.PostgresClient;
import org.folio.rest.persist.PostgresClientFuturized;
+import org.folio.rest.persist.PostgresClientStreamResult;
import org.folio.rest.persist.SQLConnection;
+import org.folio.rest.persist.cql.CQLWrapper;
+import org.folio.rest.persist.facets.FacetField;
+import org.folio.rest.persist.facets.FacetManager;
import org.folio.rest.persist.interfaces.Results;
+import org.folio.utils.ObjectConverterUtils;
public abstract class AbstractRepository {
+
+ private static final Logger logger = LogManager.getLogger();
+ private static final ObjectMapper OBJECT_MAPPER = ObjectMapperTool.getMapper();
+ private static final String JSON_COLUMN = "jsonb";
+
protected final PostgresClientFuturized postgresClientFuturized;
protected final PostgresClient postgresClient;
protected final String tableName;
@@ -70,7 +96,7 @@ public Future