Skip to content

Commit

Permalink
MODINVSTOR-1342: Add "deleted" field to Instance schema (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiBordak authored Feb 12, 2025
1 parent 8aac814 commit 8225f3e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Description ([ISSUE](https://folio-org.atlassian.net/browse/ISSUE))

### New APIs versions
* Provides `API_NAME vX.Y`
* Provides `instance-storage v11.1`
* Requires `API_NAME vX.Y`

### Features
* update rollback mechanism for instances when linking/unlinking with subjects is failed. ([MODINVSTOR-1299](https://folio-org.atlassian.net/browse/MODINVSTOR-1299))
* Update rollback mechanism for instances when linking/unlinking with subjects is failed. ([MODINVSTOR-1299](https://folio-org.atlassian.net/browse/MODINVSTOR-1299))
* Unable to delete local Subject types/sources when they are linked to an Instance ([MODINVSTOR-1284](https://folio-org.atlassian.net/browse/MODINVSTOR-1284))
* Modify endpoint for bulk instances upsert with publish events flag ([MODINVSTOR-1283](https://folio-org.atlassian.net/browse/MODINVSTOR-1283))
* Change Kafka event publishing keys for holdings and items ([MODINVSTOR-1281](https://folio-org.atlassian.net/browse/MODINVSTOR-1281))
Expand All @@ -19,6 +19,7 @@
* Extend domain events with eventId and eventTs ([MODINVSTOR-1322](https://folio-org.atlassian.net/browse/MODINVSTOR-1322))
* Revert the publication period migration changes ([MODINVSTOR-1280](https://folio-org.atlassian.net/browse/MODINVSTOR-1280))
* Optimize check for existing shadow Instance before creating it ([MODINVSTOR-1354](https://folio-org.atlassian.net/browse/MODINVSTOR-1354))
* Add "deleted" field to Instance schema ([MODINVSTOR-1342](https://folio-org.atlassian.net/browse/MODINVSTOR-1342))

### Bug fixes
* Add item barcode right truncation search index ([MODINVSTOR-1292](https://folio-org.atlassian.net/browse/MODINVSTOR-1292))
Expand Down
2 changes: 1 addition & 1 deletion descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
},
{
"id": "instance-storage",
"version": "11.0",
"version": "11.1",
"handlers": [
{
"methods": ["GET"],
Expand Down
5 changes: 5 additions & 0 deletions ramls/instance.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@
"description": "Records the fact that the record should not be displayed in a discovery system",
"default": false
},
"deleted": {
"type": "boolean",
"description": "Indicates whether the record was marked for deletion",
"default": false
},
"statisticalCodeIds": {
"type": "array",
"description": "List of statistical code IDs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static Instance mapBulkInstanceRecordToInstance(JsonObject extendedInstan
public static void copyNonMarcControlledFields(Instance targetInstance, Instance sourceInstance) {
targetInstance.setStaffSuppress(sourceInstance.getStaffSuppress());
targetInstance.setDiscoverySuppress(sourceInstance.getDiscoverySuppress());
targetInstance.setDeleted(sourceInstance.getDeleted());
targetInstance.setCatalogedDate(sourceInstance.getCatalogedDate());
targetInstance.setStatusId(sourceInstance.getStatusId());
targetInstance.setStatusUpdatedDate(sourceInstance.getStatusUpdatedDate());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void shouldPopulateFieldsNotControlledByMarc() {
Instance sourceInstance = new Instance()
.withDiscoverySuppress(Boolean.TRUE)
.withStaffSuppress(Boolean.TRUE)
.withDeleted(Boolean.TRUE)
.withPreviouslyHeld(Boolean.TRUE)
.withCatalogedDate("1970-01-01")
.withStatusId(UUID.randomUUID().toString())
Expand All @@ -49,6 +50,7 @@ public void shouldPopulateFieldsNotControlledByMarc() {

assertEquals(sourceInstance.getDiscoverySuppress(), targetInstance.getDiscoverySuppress());
assertEquals(sourceInstance.getStaffSuppress(), targetInstance.getStaffSuppress());
assertEquals(sourceInstance.getDeleted(), targetInstance.getDeleted());
assertEquals(sourceInstance.getPreviouslyHeld(), targetInstance.getPreviouslyHeld());
assertEquals(sourceInstance.getCatalogedDate(), targetInstance.getCatalogedDate());
assertEquals(sourceInstance.getStatusId(), targetInstance.getStatusId());
Expand Down

0 comments on commit 8225f3e

Please sign in to comment.