From 136e6d1d6a3e7c358908eac742c5f1a87cadb0ab Mon Sep 17 00:00:00 2001 From: Kevin Marete Date: Thu, 11 Dec 2025 13:41:09 -0500 Subject: [PATCH 1/3] Rename attribute intellectualProperty to intellectualProperties --- .../consent/http/models/DataAccessRequest.java | 2 +- .../consent/http/models/DataAccessRequestData.java | 10 +++++----- .../http/service/DataAccessRequestServiceTest.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequest.java b/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequest.java index 799a0be9c1..f53ea38439 100644 --- a/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequest.java +++ b/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequest.java @@ -353,7 +353,7 @@ public static DataAccessRequest populateProgressReportFromJsonString( originalDataCopy.setExternalCollaborators(newData.getExternalCollaborators()); originalDataCopy.setLabCollaborators(newData.getLabCollaborators()); originalDataCopy.setProgressReportSummary(newData.getProgressReportSummary()); - originalDataCopy.setIntellectualProperty(newData.getIntellectualProperty()); + originalDataCopy.setIntellectualProperties(newData.getIntellectualProperties()); originalDataCopy.setPublications(newData.getPublications()); originalDataCopy.setPresentations(newData.getPresentations()); originalDataCopy.setDmi(newData.getDmi()); diff --git a/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequestData.java b/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequestData.java index d79edd8701..e24d3ed76e 100644 --- a/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequestData.java +++ b/src/main/java/org/broadinstitute/consent/http/models/DataAccessRequestData.java @@ -124,7 +124,7 @@ public class DataAccessRequestData { // Progress Report/Closeout Fields private String progressReportSummary; - private List intellectualProperty; + private List intellectualProperties; private List publications; private List presentations; private DataManagementIncident dmi; @@ -709,12 +709,12 @@ public void setProgressReportSummary(String progressReportSummary) { this.progressReportSummary = progressReportSummary; } - public List getIntellectualProperty() { - return intellectualProperty; + public List getIntellectualProperties() { + return intellectualProperties; } - public void setIntellectualProperty(List intellectualProperty) { - this.intellectualProperty = intellectualProperty; + public void setIntellectualProperties(List intellectualProperties) { + this.intellectualProperties = intellectualProperties; } public List getPublications() { diff --git a/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java b/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java index 002788b264..d27ec9b349 100644 --- a/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java +++ b/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java @@ -901,7 +901,7 @@ private DataAccessRequest generateProgressReport() { progressReport.getData().setProgressReportSummary("Progress Report Summary"); progressReport .getData() - .setIntellectualProperty( + .setIntellectualProperties( List.of( new IntellectualProperty( "Patent", From 7aa5840e94356094f55d642828912c520125e460 Mon Sep 17 00:00:00 2001 From: Kevin Marete Date: Thu, 11 Dec 2025 13:47:18 -0500 Subject: [PATCH 2/3] Add migration for intellectualProperty to intellectualProperties --- src/main/resources/changelog-master.xml | 2 ++ ...me-intellectual-property-to-properties.xml | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/main/resources/changesets/changelog-consent-2025-12-11-rename-intellectual-property-to-properties.xml diff --git a/src/main/resources/changelog-master.xml b/src/main/resources/changelog-master.xml index 20ed6a5a81..0ed849b270 100644 --- a/src/main/resources/changelog-master.xml +++ b/src/main/resources/changelog-master.xml @@ -216,4 +216,6 @@ relativeToChangelogFile="true" /> + diff --git a/src/main/resources/changesets/changelog-consent-2025-12-11-rename-intellectual-property-to-properties.xml b/src/main/resources/changesets/changelog-consent-2025-12-11-rename-intellectual-property-to-properties.xml new file mode 100644 index 0000000000..f470141769 --- /dev/null +++ b/src/main/resources/changesets/changelog-consent-2025-12-11-rename-intellectual-property-to-properties.xml @@ -0,0 +1,22 @@ + + + + + Rename intellectualProperty field to intellectualProperties in data_access_request table. + Transforms the singular field name to plural form. + + + UPDATE data_access_request + SET data = jsonb_set( + data #- '{intellectualProperty}', + '{intellectualProperties}', + data -> 'intellectualProperty' + ) + WHERE parent_id IS NOT NULL + AND data -> 'intellectualProperty' IS NOT NULL + AND data -> 'intellectualProperties' IS NULL; + + + \ No newline at end of file From 8ffe7896eb205b3472d477218bf0f581b4d9f031 Mon Sep 17 00:00:00 2001 From: Kevin Marete Date: Thu, 11 Dec 2025 14:10:46 -0500 Subject: [PATCH 3/3] Remove date and change filingDate type --- .../consent/http/models/IntellectualProperty.java | 3 +-- .../consent/http/service/DataAccessRequestServiceTest.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java b/src/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java index 4a30f55f67..8c2495d54e 100644 --- a/src/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java +++ b/src/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java @@ -5,10 +5,9 @@ public record IntellectualProperty( String type, String title, - String date, String assignee, String patentNumber, - Boolean filingDate, + String filingDate, String status, String url, String contact, diff --git a/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java b/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java index d27ec9b349..59d86ac5e2 100644 --- a/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java +++ b/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java @@ -906,10 +906,9 @@ private DataAccessRequest generateProgressReport() { new IntellectualProperty( "Patent", "Description of patent", - "2024-01-01", "Test Assignee", "US12345678", - true, + "2024-01-01", "Active", "https://example.com", "contact@example.com",