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 799a0be9c..f53ea3843 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 d79edd870..e24d3ed76 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/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java b/src/main/java/org/broadinstitute/consent/http/models/IntellectualProperty.java index 4a30f55f6..8c2495d54 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/main/resources/changelog-master.xml b/src/main/resources/changelog-master.xml index 20ed6a5a8..0ed849b27 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 000000000..f47014176 --- /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 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 002788b26..59d86ac5e 100644 --- a/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java +++ b/src/test/java/org/broadinstitute/consent/http/service/DataAccessRequestServiceTest.java @@ -901,15 +901,14 @@ private DataAccessRequest generateProgressReport() { progressReport.getData().setProgressReportSummary("Progress Report Summary"); progressReport .getData() - .setIntellectualProperty( + .setIntellectualProperties( List.of( new IntellectualProperty( "Patent", "Description of patent", - "2024-01-01", "Test Assignee", "US12345678", - true, + "2024-01-01", "Active", "https://example.com", "contact@example.com",