From a1f7766c0329b73faf1d54edacd54b9501a9a15e Mon Sep 17 00:00:00 2001 From: Dzmitry_Butramyou Date: Fri, 9 Feb 2024 18:26:46 +0400 Subject: [PATCH 1/3] [MODORDERS-1017] - Add the displaySummary field to the schema --- ramls/inventory/item.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ramls/inventory/item.json b/ramls/inventory/item.json index cb749dc4..b4c5dc1e 100644 --- a/ramls/inventory/item.json +++ b/ramls/inventory/item.json @@ -400,6 +400,10 @@ "$ref": "../raml-util/schemas/uuid.schema" } } + }, + "displaySummary": { + "description": "A summary of the item", + "type": "string" } }, "additionalProperties": true, From 8baf2859a4dd1a73e62c837c022f44e02f3a0111 Mon Sep 17 00:00:00 2001 From: Dzmitry_Butramyou Date: Mon, 12 Feb 2024 16:55:01 +0400 Subject: [PATCH 2/3] [MODORDERS-1017] - Add displaySummary field --- src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java | 1 + src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java | 1 + src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java b/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java index 8a325fe0..47f3d61f 100644 --- a/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java +++ b/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java @@ -101,6 +101,7 @@ private static JsonObject buildItemContext(FeeFineNoticeContext ctx) { .put("enumeration", item.getEnumeration()) .put("volume", item.getVolume()) .put("chronology", item.getChronology()) + .put("displaySummary", item.getDisplaySummary()) .put("yearCaption", String.join(LIST_VALUES_SEPARATOR, item.getYearCaption())) .put("copy", getCopyNumber(item, holdingsRecord)) .put("numberOfPieces", item.getNumberOfPieces()) diff --git a/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java b/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java index 396f74f6..7990f70a 100644 --- a/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java +++ b/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java @@ -333,6 +333,7 @@ public void postActionWithPatronNotice() { .put("enumeration", item.getEnumeration()) .put("volume", item.getVolume()) .put("chronology", item.getChronology()) + .put("displaySummary", item.getDisplaySummary()) .put("yearCaption", "2000") .put("copy", item.getCopyNumber()) .put("numberOfPieces", item.getNumberOfPieces()) diff --git a/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java b/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java index 01112872..18757bb7 100644 --- a/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java +++ b/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java @@ -108,6 +108,7 @@ public void createContextWithAllAvailableFields() { assertEquals(item.getEnumeration(), itemContext.getString("enumeration")); assertEquals(item.getVolume(), itemContext.getString("volume")); assertEquals(item.getChronology(), itemContext.getString("chronology")); + assertEquals(item.getDisplaySummary(), itemContext.getString("displaySummary")); assertEquals("2001; 2000", itemContext.getString("yearCaption")); assertEquals(item.getCopyNumber(), itemContext.getString("copy")); assertEquals(item.getNumberOfPieces(), itemContext.getString("numberOfPieces")); From beb02534af1fc632495980bae716fd7ff5cacf25 Mon Sep 17 00:00:00 2001 From: Dzmitry_Butramyou Date: Thu, 15 Feb 2024 15:52:49 +0400 Subject: [PATCH 3/3] [MODORDERS-1017] - Refactored --- src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java | 1 - src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java | 1 - src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java | 1 - 3 files changed, 3 deletions(-) diff --git a/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java b/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java index 47f3d61f..8a325fe0 100644 --- a/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java +++ b/src/main/java/org/folio/rest/utils/PatronNoticeBuilder.java @@ -101,7 +101,6 @@ private static JsonObject buildItemContext(FeeFineNoticeContext ctx) { .put("enumeration", item.getEnumeration()) .put("volume", item.getVolume()) .put("chronology", item.getChronology()) - .put("displaySummary", item.getDisplaySummary()) .put("yearCaption", String.join(LIST_VALUES_SEPARATOR, item.getYearCaption())) .put("copy", getCopyNumber(item, holdingsRecord)) .put("numberOfPieces", item.getNumberOfPieces()) diff --git a/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java b/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java index 7990f70a..396f74f6 100644 --- a/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java +++ b/src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java @@ -333,7 +333,6 @@ public void postActionWithPatronNotice() { .put("enumeration", item.getEnumeration()) .put("volume", item.getVolume()) .put("chronology", item.getChronology()) - .put("displaySummary", item.getDisplaySummary()) .put("yearCaption", "2000") .put("copy", item.getCopyNumber()) .put("numberOfPieces", item.getNumberOfPieces()) diff --git a/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java b/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java index 18757bb7..01112872 100644 --- a/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java +++ b/src/test/java/org/folio/rest/utils/PatronNoticeBuilderTest.java @@ -108,7 +108,6 @@ public void createContextWithAllAvailableFields() { assertEquals(item.getEnumeration(), itemContext.getString("enumeration")); assertEquals(item.getVolume(), itemContext.getString("volume")); assertEquals(item.getChronology(), itemContext.getString("chronology")); - assertEquals(item.getDisplaySummary(), itemContext.getString("displaySummary")); assertEquals("2001; 2000", itemContext.getString("yearCaption")); assertEquals(item.getCopyNumber(), itemContext.getString("copy")); assertEquals(item.getNumberOfPieces(), itemContext.getString("numberOfPieces"));