Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tdr 3429 update graphql queries #3359

Merged
merged 5 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/ConfirmTransferController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ConfirmTransferController @Inject() (
consignmentService
.getConsignmentConfirmTransfer(consignmentId, request.token.bearerAccessToken)
.map { summary =>
ConsignmentSummaryData(summary.series.get.code, summary.transferringBody.get.name, summary.totalFiles, summary.consignmentReference)
ConsignmentSummaryData(summary.seriesName.get, summary.transferringBodyName.get, summary.totalFiles, summary.consignmentReference)
}
}

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/SeriesDetailsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class SeriesDetailsController @Inject() (
result <- seriesStatus match {
case Some(CompletedValue.value) =>
val seriesOption: InputNameAndValue = consignmentStatus
.flatMap(_.series)
.map(series => InputNameAndValue(series.code, series.seriesid.toString))
.map(c => InputNameAndValue(c.seriesName.getOrElse(""), c.seriesid.getOrElse("").toString))
.get

Future(
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ libraryDependencies ++= Seq(
"com.softwaremill.sttp.client" %% "async-http-client-backend-future" % sttpVersion,
"uk.gov.nationalarchives" %% "tdr-graphql-client" % "0.0.132",
"uk.gov.nationalarchives" %% "tdr-auth-utils" % "0.0.168",
"uk.gov.nationalarchives" %% "tdr-generated-graphql" % "0.0.349",
"uk.gov.nationalarchives" %% "tdr-generated-graphql" % "0.0.350",
"com.github.tototoshi" %% "scala-csv" % "1.3.10",
"ch.qos.logback" % "logback-classic" % "1.4.11",
ws,
Expand Down
8 changes: 4 additions & 4 deletions test/controllers/ConfirmTransferControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ConfirmTransferControllerSpec extends FrontEndTestHelper {

confirmTransferPageAsString must include(
s""" <dd class="govuk-summary-list__value">
| ${consignmentSummaryResponse.series.get.code}
| ${consignmentSummaryResponse.seriesName.get}
| </dd>""".stripMargin
)

Expand All @@ -137,7 +137,7 @@ class ConfirmTransferControllerSpec extends FrontEndTestHelper {

confirmTransferPageAsString must include(
s""" <dd class="govuk-summary-list__value">
| ${consignmentSummaryResponse.transferringBody.get.name}
| ${consignmentSummaryResponse.transferringBodyName.get}
| </dd>""".stripMargin
)

Expand Down Expand Up @@ -676,8 +676,8 @@ class ConfirmTransferControllerSpec extends FrontEndTestHelper {
}

private def getConsignmentSummaryResponse: gcs.GetConsignment = {
val seriesCode = Some(gcs.GetConsignment.Series("Mock Series 2"))
val transferringBodyName = Some(gcs.GetConsignment.TransferringBody("MockBody 2"))
val seriesCode = Some("Mock Series 2")
val transferringBodyName = Some("MockBody 2")
val totalFiles: Int = 4
val consignmentReference = "TEST-TDR-2021-GB"
new gcs.GetConsignment(seriesCode, transferringBodyName, totalFiles, consignmentReference)
Expand Down
1 change: 1 addition & 0 deletions test/services/ConsignmentStatusServiceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class ConsignmentStatusServiceSpec extends AnyWordSpec with MockitoSugar with Be
gcs.Data(
Option(
gcs.GetConsignment(
None,
None,
statuses
)
Expand Down
7 changes: 4 additions & 3 deletions test/testUtils/FrontEndTestHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import graphql.codegen.GetAllDescendants.getAllDescendantIds
import graphql.codegen.GetAllDescendants.getAllDescendantIds.AllDescendants
import graphql.codegen.GetConsignmentFilesMetadata.getConsignmentFilesMetadata.GetConsignment.Files.{FileMetadata, FileStatuses}
import graphql.codegen.GetConsignmentFilesMetadata.{getConsignmentFilesMetadata => gcfm}
import graphql.codegen.GetConsignmentStatus.getConsignmentStatus.GetConsignment
import graphql.codegen.GetConsignmentFiles.{getConsignmentFiles => gcf}
import graphql.codegen.GetConsignmentStatus.getConsignmentStatus.GetConsignment.{ConsignmentStatuses, Series}
import graphql.codegen.GetConsignmentStatus.getConsignmentStatus.GetConsignment.ConsignmentStatuses
import graphql.codegen.GetConsignmentStatus.{getConsignmentStatus => gcs}
import graphql.codegen.GetConsignments.getConsignments.Consignments
import graphql.codegen.GetConsignments.getConsignments.Consignments.Edges
Expand Down Expand Up @@ -69,6 +68,7 @@ import play.api.{Application, Configuration}
import uk.gov.nationalarchives.tdr.GraphQLClient
import uk.gov.nationalarchives.tdr.keycloak.Token
import graphql.codegen.GetConsignment.{getConsignment => gcd}
import graphql.codegen.GetConsignmentStatus.getConsignmentStatus.GetConsignment
import services.Statuses.{InProgressValue, SeriesType}
import viewsapi.FrontEndInfo

Expand Down Expand Up @@ -242,7 +242,8 @@ trait FrontEndTestHelper extends PlaySpec with MockitoSugar with Injecting with
val consignmentResponse = gcs.Data(
Option(
GetConsignment(
Some(Series(seriesId.getOrElse(UUID.randomUUID()), "MOCK1")),
seriesId,
Some("MOCK1"),
consignmentStatuses
)
)
Expand Down