Skip to content

Commit

Permalink
More little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-parker committed Jul 30, 2024
1 parent 75e3b07 commit 84ea087
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ReleasedDataModel(
}

var metadata = rawProcessedData.processedData.metadata +
("version_comments" to TextNode(rawProcessedData.revocationComments)) +
("accession" to TextNode(rawProcessedData.accession)) +
("version" to LongNode(rawProcessedData.version)) +
(HEADER_TO_CONNECT_METADATA_AND_SEQUENCES to TextNode(rawProcessedData.submissionId)) +
Expand All @@ -74,6 +73,10 @@ class ReleasedDataModel(
("dataUseTerms" to TextNode(currentDataUseTerms.type.name)) +
("dataUseTermsRestrictedUntil" to restrictedDataUseTermsUntil)

if (siloVersionStatus == SiloVersionStatus.REVOKED) {
metadata += ("version_comments" to TextNode(rawProcessedData.revocationComments))
}

if (backendConfig.dataUseTermsUrls != null) {
val url = if (rawProcessedData.dataUseTerms == DataUseTerms.Open) {
backendConfig.dataUseTermsUrls.open
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/db/migration/V1__init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ create table sequence_entries (
submitted_at timestamp not null,
released_at timestamp,
is_revocation boolean not null default false,
revocation_comment text,
revocation_comments text,
original_data jsonb,
primary key (accession, version),
foreign key (group_id) references groups_table(group_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,17 @@ class GetReleasedDataEndpointTest(
value,
`is`(TextNode(Clock.System.now().toLocalDateTime(TimeZone.UTC).date.toString())),
)

"releasedDate" -> assertThat(
value,
`is`(TextNode(Clock.System.now().toLocalDateTime(TimeZone.UTC).date.toString())),
)

"revocationComments" -> assertThat(
value,
`is`(TextNode("")),
)

else -> assertThat("value for $key", value, `is`(NullNode.instance))
}
}
Expand Down

0 comments on commit 84ea087

Please sign in to comment.