Skip to content

Commit

Permalink
Merge pull request #4 from hmrc/MIBM-78
Browse files Browse the repository at this point in the history
Mibm 78
  • Loading branch information
PaulHodgson authored Sep 22, 2020
2 parents 2e0f3fc + 1b52803 commit eb34593
Show file tree
Hide file tree
Showing 9 changed files with 380 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2020 HM Revenue & Customs
*
*/

package uk.gov.hmrc.merchandiseinbaggagefrontend.controllers

import javax.inject.Inject
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.merchandiseinbaggagefrontend.config.AppConfig
import uk.gov.hmrc.merchandiseinbaggagefrontend.views.html.CheckYourAnswersPage
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController

import scala.concurrent.ExecutionContext

class CheckYourAnswersController @Inject()(mcc: MessagesControllerComponents, page: CheckYourAnswersPage)
(implicit val ec: ExecutionContext, appConfig: AppConfig)
extends FrontendController(mcc) {

val onPageLoad: Action[AnyContent] = Action { implicit request =>
Ok(page())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright 2020 HM Revenue & Customs
*
*/

package uk.gov.hmrc.merchandiseinbaggagefrontend.controllers

import javax.inject.Inject
import play.api.mvc.{Action, AnyContent, Call, MessagesControllerComponents}
import uk.gov.hmrc.merchandiseinbaggagefrontend.config.AppConfig
import uk.gov.hmrc.merchandiseinbaggagefrontend.views.html.SkeletonPage
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController

import scala.concurrent.ExecutionContext

/**
* Controller serving skeleton pages
*
* It is envisaged this controller will be re-factored away action-by-action as we build out the journey
*/
class SkeletonJourneyController @Inject()(mcc: MessagesControllerComponents, page: SkeletonPage)
(implicit val ec: ExecutionContext, appConfig: AppConfig)
extends FrontendController(mcc) {

val start: Action[AnyContent] =
displaySkeletonPage("start.title", routes.SkeletonJourneyController.importExport())

val importExport: Action[AnyContent] =
displaySkeletonPage("importExport.title", routes.SkeletonJourneyController.multipleCountriesEuCheck())

val multipleCountriesEuCheck: Action[AnyContent] =
displaySkeletonPage("multipleCountriesEuCheck.title", routes.SkeletonJourneyController.goodsExcise())

val goodsExcise: Action[AnyContent] =
displaySkeletonPage("goodsExcise.title", routes.SkeletonJourneyController.valueWeightOfGoods())

val valueWeightOfGoods: Action[AnyContent] =
displaySkeletonPage("valueWeightOfGoods.title", routes.SkeletonJourneyController.goodsType())

val goodsType: Action[AnyContent] =
displaySkeletonPage("goodsType.title", routes.SkeletonJourneyController.goodsCategory())

val goodsCategory: Action[AnyContent] =
displaySkeletonPage("goodsCategory.title", routes.SkeletonJourneyController.goodsDetailsWhere())

val goodsDetailsWhere: Action[AnyContent] =
displaySkeletonPage("goodsDetailsWhere.title", routes.SkeletonJourneyController.goodsDetailsCost())

val goodsDetailsCost: Action[AnyContent] =
displaySkeletonPage("goodsDetailsCost.title", routes.SkeletonJourneyController.goodsReview())

val goodsReview: Action[AnyContent] =
displaySkeletonPage("goodsReview.title", routes.SkeletonJourneyController.calculation())

val calculation: Action[AnyContent] =
displaySkeletonPage("calculation.title", routes.SkeletonJourneyController.traderAgent())

val traderAgent: Action[AnyContent] =
displaySkeletonPage("traderAgent.title", routes.SkeletonJourneyController.traderDetails())

val traderDetails: Action[AnyContent] =
displaySkeletonPage("traderDetails.title", routes.SkeletonJourneyController.traderAddress())

val traderAddress: Action[AnyContent] =
displaySkeletonPage("traderAddress.title", routes.SkeletonJourneyController.traderAddressList())

val traderAddressList: Action[AnyContent] =
displaySkeletonPage("traderAddressList.title", routes.SkeletonJourneyController.traderEori())

val traderEori: Action[AnyContent] =
displaySkeletonPage("traderEori.title", routes.SkeletonJourneyController.traderJourney())

val traderJourney: Action[AnyContent] =
displaySkeletonPage("traderJourney.title", routes.CheckYourAnswersController.onPageLoad())

private def displaySkeletonPage(titleMessageKey: String, next: Call) = Action { implicit request =>
Ok(page(titleMessageKey, next))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@*
* Copyright 2020 HM Revenue & Customs
*
*@

@import uk.gov.hmrc.merchandiseinbaggagefrontend.config.AppConfig

@this(layout: Layout)

@()(implicit request: Request[_], messages: Messages, appConfig: AppConfig)

@layout(pageTitle = Some(messages("checkYourAnswers.title"))) {
<h1 class="govuk-heading-l" id="main-message">@messages("checkYourAnswers.title")</h1>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@*
* Copyright 2020 HM Revenue & Customs
*
*@

@import play.api.mvc.Call
@import uk.gov.hmrc.merchandiseinbaggagefrontend.config.AppConfig

@this(layout: Layout, val button: components.button)

@(titleMessageKey: String, next: Call)(implicit request: Request[_], messages: Messages, appConfig: AppConfig)

@layout(pageTitle = Some(messages(titleMessageKey))) {
<h1 class="govuk-heading-l" id="main-message">@messages(titleMessageKey)</h1>

@button(messages("next.button"), href = Some(next.url), classes = Some("govuk-button"))
}
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ val silencerVersion = "1.7.0"

lazy val microservice = Project(appName, file("."))
.enablePlugins(play.sbt.PlayScala, SbtAutoBuildPlugin, SbtGitVersioning, SbtDistributablesPlugin, SbtArtifactory)
.disablePlugins(JUnitXmlReportPlugin)
.settings(
majorVersion := 0,
scalaVersion := "2.12.11",
Expand Down
30 changes: 25 additions & 5 deletions conf/app.routes
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
# microservice specific routes

-> /govuk-frontend govuk.Routes
-> /hmrc-frontend hmrcfrontend.Routes
-> /govuk-frontend govuk.Routes
-> /hmrc-frontend hmrcfrontend.Routes

GET /assets/*file controllers.Assets.versioned(path = "/public", file: Asset)
GET /assets/*file controllers.Assets.versioned(path = "/public", file: Asset)

GET /payment uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.PaymentController.onPageLoad
GET /process-payment uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.PaymentController.onSubmit()
GET /payment uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.PaymentController.onPageLoad
GET /process-payment uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.PaymentController.onSubmit()

GET /start uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.start
GET /import-export uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.importExport
GET /multiple-countries-eu-check uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.multipleCountriesEuCheck
GET /goods-excise uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsExcise
GET /value-weight-of-goods uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.valueWeightOfGoods
GET /goods-type uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsType
GET /goods-category uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsCategory
GET /goods-details-where uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsDetailsWhere
GET /goods-details-cost uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsDetailsCost
GET /goods-review uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.goodsReview
GET /calculation uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.calculation
GET /trader-agent uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderAgent
GET /trader-details uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderDetails
GET /trader-address uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderAddress
GET /trader-address-list uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderAddressList
GET /trader-eori uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderEori
GET /trader-journey uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderJourney

GET /check-your-answers uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.CheckYourAnswersController.onPageLoad
22 changes: 21 additions & 1 deletion conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,24 @@ footer.termsConditions.url = /help/terms-and-conditions
footer.govukHelp.text = Help using GOV.UK
footer.govukHelp.url = https://www.gov.uk/help

payment.button = Pay now
payment.button = Pay now
next.button = Next

start.title = Declaring merchandise in your baggage
importExport.title = What do you need to declare?
multipleCountriesEuCheck.title = Where are the goods coming from?
goodsExcise.title = Are you bringing in excise or restricted goods?
valueWeightOfGoods.title = Is the total value of the goods over £873 or 1000kg?
goodsType.title = Enter the detail of each individual item
goodsCategory.title = Which rate of VAT do the goods fit into?
goodsDetailsWhere.title = In which country did you purchase the goods?
goodsDetailsCost.title = How much did you pay for the goods?
goodsReview.title = Review your goods
calculation.title = Tax due on these goods
traderAgent.title = Are you a customs agent?
traderDetails.title = What is the name of carrying the goods?
traderAddress.title = What is your address?
traderAddressList.title = Select your address
traderEori.title = What is your EORI number?
traderJourney.title = What your journey details?
checkYourAnswers.title = Check your answers before making your declaration
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2020 HM Revenue & Customs
*
*/

package uk.gov.hmrc.merchandiseinbaggagefrontend.controllers

import play.api.test.Helpers._
import uk.gov.hmrc.merchandiseinbaggagefrontend.BaseSpecWithApplication

class CheckYourAnswersControllerSpec extends BaseSpecWithApplication {
private lazy val controller = app.injector.instanceOf[CheckYourAnswersController]

"onPageLoad" should {
"render the page" in {
val getRequest = buildGet(routes.CheckYourAnswersController.onPageLoad().url)

val eventualResponse = controller.onPageLoad(getRequest)
status(eventualResponse) mustBe 200
contentAsString(eventualResponse) must include("Check your answers before making your declaration")
}
}
}
Loading

0 comments on commit eb34593

Please sign in to comment.