Skip to content

Commit

Permalink
refactor(holdings-storage): prevent virtual fields populating (#952)
Browse files Browse the repository at this point in the history
Closes: MODINVSTOR-1094
  • Loading branch information
psmagin authored Nov 30, 2023
1 parent 23fb590 commit c25b847
Show file tree
Hide file tree
Showing 52 changed files with 586 additions and 497 deletions.
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

### Bug fixes
* Fix reference and sample data ([MODINVSTOR-1116](https://issues.folio.org/browse/MODINVSTOR-1116), [MODINVSTOR-1115](https://issues.folio.org/browse/MODINVSTOR-1115))
* Description ([ISSUE_NUMBER](https://issues.folio.org/browse/ISSUE_NUMBER))

### Tech Dept
* Description ([ISSUE_NUMBER](https://issues.folio.org/browse/ISSUE_NUMBER))
* Prevent virtual fields populating for holdings records ([MODINVSTOR-1094](https://issues.folio.org/browse/MODINVSTOR-1094))

---

Expand Down
2 changes: 1 addition & 1 deletion ramls/dereferenceditem.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"holdingsRecord": {
"type": "object",
"description": "Holdings record the item is a member of.",
"$ref": "holdingsrecord.json"
"$ref": "holdings-storage/holdingsRecord.json"
},
"formerIds": {
"type": "array",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions ramls/examples/instance-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.770+00:00",
"updatedDate": "2021-02-24T09:30:15.770+00:00"
Expand All @@ -84,8 +82,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.786+00:00",
"updatedDate": "2021-02-24T09:30:15.786+00:00"
Expand All @@ -104,8 +100,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.811+00:00",
"updatedDate": "2021-02-24T09:30:15.811+00:00"
Expand Down
6 changes: 0 additions & 6 deletions ramls/examples/inventory-view-instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.770+00:00",
"updatedDate": "2021-02-24T09:30:15.770+00:00"
Expand All @@ -84,8 +82,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.786+00:00",
"updatedDate": "2021-02-24T09:30:15.786+00:00"
Expand All @@ -104,8 +100,6 @@
"holdingsStatementsForIndexes": [],
"holdingsStatementsForSupplements": [],
"statisticalCodeIds": [],
"holdingsItems": [],
"bareHoldingsItems": [],
"metadata": {
"createdDate": "2021-02-24T09:30:15.811+00:00",
"updatedDate": "2021-02-24T09:30:15.811+00:00"
Expand Down
10 changes: 5 additions & 5 deletions ramls/holdings-note-type.raml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ documentation:
content: This documents the API calls that can be made to query and manage holdings note types of the system

types:
holdingsNoteType: !include holdingsnotetype.json
holdingsNoteTypes: !include holdingsnotetypes.json
holdingsNoteType: !include holdings-note-types/holdingsNoteType.json
holdingsNoteTypes: !include holdings-note-types/holdingsNoteTypes.json
errors: !include raml-util/schemas/errors.schema

traits:
Expand All @@ -26,8 +26,8 @@ resourceTypes:
/holdings-note-types:
type:
collection:
exampleCollection: !include examples/holdingsnotetypes.json
exampleItem: !include examples/holdingsnotetype.json
exampleCollection: !include examples/holdings-note-types/holdingsNoteTypes.json
exampleItem: !include examples/holdings-note-types/holdingsNoteType.json
schemaCollection: holdingsNoteTypes
schemaItem: holdingsNoteType
get:
Expand All @@ -43,6 +43,6 @@ resourceTypes:
description: "Pass in the holdings note type id"
type:
collection-item:
exampleItem: !include examples/holdingsnotetype.json
exampleItem: !include examples/holdings-note-types/holdingsNoteType.json
schema: holdingsNoteType

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"metadata": {
"type": "object",
"$ref": "raml-util/schemas/metadata.schema",
"$ref": "../raml-util/schemas/metadata.schema",
"readonly": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "array",
"items": {
"type": "object",
"$ref": "holdingsnotetype.json"
"$ref": "holdingsNoteType.json"
}
},
"totalRecords": {
Expand Down
10 changes: 5 additions & 5 deletions ramls/holdings-sources.raml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ documentation:
content: This documents the API calls that can be made to query and manage holdings records sources

types:
holdingsRecordsSource: !include holdingsrecordssource.json
holdingsRecordsSources: !include holdingsrecordssources.json
holdingsRecordsSource: !include holdings-sources/holdingsRecordsSource.json
holdingsRecordsSources: !include holdings-sources/holdingsRecordsSources.json
errors: !include raml-util/schemas/errors.schema

traits:
Expand All @@ -26,8 +26,8 @@ resourceTypes:
/holdings-sources:
type:
collection:
exampleCollection: !include examples/holdingsrecordssources.json
exampleItem: !include examples/holdingsrecordssource.json
exampleCollection: !include examples/holdings-sources/holdingsRecordsSources.json
exampleItem: !include examples/holdings-sources/holdingsRecordsSource.json
schemaCollection: holdingsRecordsSources
schemaItem: holdingsRecordsSource
get:
Expand All @@ -43,5 +43,5 @@ resourceTypes:
description: Pass in the holdings records source id
type:
collection-item:
exampleItem: !include examples/holdingsrecordssource.json
exampleItem: !include examples/holdings-sources/holdingsRecordsSource.json
schema: holdingsRecordsSource
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": {
"type": "string",
"description": "The unique ID of the holdings records source; UUID",
"$ref": "uuid.json"
"$ref": "../uuid.json"
},
"name": {
"type": "string",
Expand All @@ -22,7 +22,7 @@
},
"metadata": {
"type": "object",
"$ref": "raml-util/schemas/metadata.schema",
"$ref": "../raml-util/schemas/metadata.schema",
"readonly": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "array",
"items": {
"type": "object",
"$ref": "holdingsrecordssource.json"
"$ref": "holdingsRecordsSource.json"
}
},
"totalRecords": {
Expand Down
32 changes: 24 additions & 8 deletions ramls/holdings-storage.raml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ documentation:
content: <b>Storage for holdings in the inventory</b>

types:
holdingsRecord: !include holdingsrecord.json
holdingsRecords: !include holdingsrecords.json
holdingsRecord: !include holdings-storage/holdingsRecord.json
holdingsRecords: !include holdings-storage/holdingsRecords.json
holdingsRecordView: !include holdings-storage/holdingsRecordView.json
holdingsRecordViews: !include holdings-storage/holdingsRecordViews.json
errors: !include raml-util/schemas/errors.schema

traits:
Expand All @@ -28,17 +30,23 @@ resourceTypes:
displayName: Holdings
type:
collection:
exampleCollection: !include examples/holdingsrecords_get.json
schemaCollection: holdingsRecords
schemaItem: holdingsRecord
exampleItem: !include examples/holdingsrecord_get.json
exampleCollection: !include examples/holdings-storage/holdingsRecords_get.json
schemaCollection: holdingsRecordViews
schemaItem: holdingsRecordView
exampleItem: !include examples/holdings-storage/holdingsRecord_get.json
get:
is: [pageable,
searchable: {description: "by instance ID (using CQL)",
example: "instanceId=\"2b94c631-fca9-4892-a730-03ee529ffe2a\""},
]
post:
is: [validate]
body:
application/json:
type: holdingsRecord
example:
strict: false
value: !include examples/holdings-storage/holdingsRecord_get.json
delete:
is: [searchable: { description: "CQL to select holdings to delete, use cql.allRecords=1 to delete all", example: "callNumber==\"123-0*\"" } ]
responses:
Expand All @@ -57,8 +65,8 @@ resourceTypes:
/{holdingsRecordId}:
type:
collection-item:
exampleItem: !include examples/holdingsrecord_get.json
schema: holdingsRecord
exampleItem: !include examples/holdings-storage/holdingsRecord_get.json
schema: holdingsRecordView
get:
responses:
200:
Expand All @@ -67,3 +75,11 @@ resourceTypes:
type: holdingsRecord
description: |
Get Holdings Record by holdingsRecordId
put:
is: [ validate ]
body:
application/json:
type: holdingsRecord
example:
strict: false
value: !include examples/holdings-storage/holdingsRecord_get.json
33 changes: 33 additions & 0 deletions ramls/holdings-storage/electronicAccessItem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Electronic access item",
"javaType": "org.folio.rest.jaxrs.model.ElectronicAccessItem",
"additionalProperties": false,
"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"
}
},
"required": [
"uri"
]
}

24 changes: 24 additions & 0 deletions ramls/holdings-storage/holdingsNote.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A holdings record note",
"javaType": "org.folio.rest.jaxrs.model.HoldingsNote",
"additionalProperties": false,
"type": "object",
"properties": {
"holdingsNoteTypeId": {
"type": "string",
"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
}
}
}

21 changes: 21 additions & 0 deletions ramls/holdings-storage/holdingsReceivingHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Receiving history of holdings record",
"javaType": "org.folio.rest.jaxrs.model.HoldingsReceivingHistory",
"additionalProperties": false,
"type": "object",
"properties": {
"displayType": {
"type": "string",
"description": "Display hint. 1: Display fields separately. 2: Display fields concatenated"
},
"entries": {
"type": "array",
"description": "Entries of receiving history",
"items": {
"$ref": "holdingsReceivingHistoryEntry.json"
}
}
}
}

22 changes: 22 additions & 0 deletions ramls/holdings-storage/holdingsReceivingHistoryEntry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Receiving history entry of holdings record",
"javaType": "org.folio.rest.jaxrs.model.HoldingsReceivingHistoryEntry",
"additionalProperties": false,
"type": "object",
"properties": {
"publicDisplay": {
"type": "boolean",
"description": "Defines if the receivingHistory should be visible to the public."
},
"enumeration": {
"type": "string",
"description": "This is the volume/issue number (e.g. v.71:no.6-2)"
},
"chronology": {
"type": "string",
"description": "Repeated element from Receiving history - Enumeration AND Receiving history - Chronology"
}
}
}

Loading

0 comments on commit c25b847

Please sign in to comment.