diff --git a/app/controllers/ConfirmTransferController.scala b/app/controllers/ConfirmTransferController.scala index c4cb1a2e5..4e1c5d56a 100644 --- a/app/controllers/ConfirmTransferController.scala +++ b/app/controllers/ConfirmTransferController.scala @@ -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) } } diff --git a/app/controllers/SeriesDetailsController.scala b/app/controllers/SeriesDetailsController.scala index 3d7a52801..3cd434842 100644 --- a/app/controllers/SeriesDetailsController.scala +++ b/app/controllers/SeriesDetailsController.scala @@ -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( diff --git a/build.sbt b/build.sbt index 51d4ef22a..73598222d 100644 --- a/build.sbt +++ b/build.sbt @@ -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, diff --git a/test/controllers/ConfirmTransferControllerSpec.scala b/test/controllers/ConfirmTransferControllerSpec.scala index 4f80e2f4f..7022d6929 100644 --- a/test/controllers/ConfirmTransferControllerSpec.scala +++ b/test/controllers/ConfirmTransferControllerSpec.scala @@ -113,7 +113,7 @@ class ConfirmTransferControllerSpec extends FrontEndTestHelper { confirmTransferPageAsString must include( s"""
- | ${consignmentSummaryResponse.series.get.code} + | ${consignmentSummaryResponse.seriesName.get} |
""".stripMargin ) @@ -137,7 +137,7 @@ class ConfirmTransferControllerSpec extends FrontEndTestHelper { confirmTransferPageAsString must include( s"""
- | ${consignmentSummaryResponse.transferringBody.get.name} + | ${consignmentSummaryResponse.transferringBodyName.get} |
""".stripMargin ) @@ -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) diff --git a/test/services/ConsignmentStatusServiceSpec.scala b/test/services/ConsignmentStatusServiceSpec.scala index d2833fc4f..a4461d918 100644 --- a/test/services/ConsignmentStatusServiceSpec.scala +++ b/test/services/ConsignmentStatusServiceSpec.scala @@ -84,6 +84,7 @@ class ConsignmentStatusServiceSpec extends AnyWordSpec with MockitoSugar with Be gcs.Data( Option( gcs.GetConsignment( + None, None, statuses ) diff --git a/test/testUtils/FrontEndTestHelper.scala b/test/testUtils/FrontEndTestHelper.scala index ba08462c1..eb9988550 100644 --- a/test/testUtils/FrontEndTestHelper.scala +++ b/test/testUtils/FrontEndTestHelper.scala @@ -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 @@ -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 @@ -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 ) )