Skip to content

Commit

Permalink
feat(backend): add group that a sequence entry for submitted by to me…
Browse files Browse the repository at this point in the history
…tadata in SILO #778
  • Loading branch information
fengelniederhammer committed Jan 25, 2024
1 parent c6f475f commit 723fb8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ReleasedDataModel(private val submissionDatabaseService: SubmissionDatabas
("accessionVersion" to TextNode(rawProcessedData.displayAccessionVersion())) +
("isRevocation" to TextNode(rawProcessedData.isRevocation.toString())) +
("submitter" to TextNode(rawProcessedData.submitter)) +
("group" to TextNode(rawProcessedData.group)) +
("submittedAt" to LongNode(rawProcessedData.submittedAt.toTimestamp())) +
("releasedAt" to LongNode(rawProcessedData.releasedAt.toTimestamp())) +
("versionStatus" to TextNode(siloVersionStatus.name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class SubmissionDatabaseService(
table.isRevocationColumn,
table.processedDataColumn,
table.submitterColumn,
table.groupNameColumn,
table.submittedAtColumn,
table.releasedAtColumn,
table.submissionIdColumn,
Expand All @@ -281,6 +282,7 @@ class SubmissionDatabaseService(
version = it[table.versionColumn],
isRevocation = it[table.isRevocationColumn],
submitter = it[table.submitterColumn],
group = it[table.groupNameColumn],
submissionId = it[table.submissionIdColumn],
processedData = it[table.processedDataColumn]!!,
submittedAt = it[table.submittedAtColumn],
Expand Down Expand Up @@ -572,6 +574,7 @@ data class RawProcessedData(
override val version: Version,
val isRevocation: Boolean,
val submitter: String,
val group: String,
val submittedAt: LocalDateTime,
val releasedAt: LocalDateTime,
val submissionId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test
import org.loculus.backend.api.AccessionVersion
import org.loculus.backend.api.ProcessedData
import org.loculus.backend.api.SiloVersionStatus
import org.loculus.backend.controller.DEFAULT_GROUP_NAME
import org.loculus.backend.controller.EndpointTest
import org.loculus.backend.controller.expectForbiddenResponse
import org.loculus.backend.controller.expectNdjsonAndGetContent
Expand Down Expand Up @@ -80,6 +81,7 @@ class GetReleasedDataEndpointTest(
"accessionVersion" to TextNode("$id.$version"),
"isRevocation" to TextNode("false"),
"submitter" to TextNode(DEFAULT_USER_NAME),
"group" to TextNode(DEFAULT_GROUP_NAME),
"versionStatus" to TextNode("LATEST_VERSION"),
)

Expand Down Expand Up @@ -178,6 +180,7 @@ class GetReleasedDataEndpointTest(
"submittedAt" -> expectIsTimestampWithCurrentYear(value)
"releasedAt" -> expectIsTimestampWithCurrentYear(value)
"submitter" -> assertThat(value, `is`(TextNode(DEFAULT_USER_NAME)))
"group" -> assertThat(value, `is`(TextNode(DEFAULT_GROUP_NAME)))
"accession", "version", "accessionVersion", "submissionId" -> {}
else -> assertThat("value for $key", value, `is`(NullNode.instance))
}
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/loculus/templates/_common-metadata.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ fields:
notSearchable: true
- name: submitter
type: string
- name: group
type: string
- name: submittedAt
type: timestamp
- name: releasedAt
Expand Down

0 comments on commit 723fb8e

Please sign in to comment.