-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from hmrc/MIBM-78
Mibm 78
- Loading branch information
Showing
9 changed files
with
380 additions
and
6 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/uk/gov/hmrc/merchandiseinbaggagefrontend/controllers/CheckYourAnswersController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
app/uk/gov/hmrc/merchandiseinbaggagefrontend/controllers/SkeletonJourneyController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/uk/gov/hmrc/merchandiseinbaggagefrontend/views/CheckYourAnswersPage.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
} |
17 changes: 17 additions & 0 deletions
17
app/uk/gov/hmrc/merchandiseinbaggagefrontend/views/SkeletonPage.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...uk/gov/hmrc/merchandiseinbaggagefrontend/controllers/CheckYourAnswersControllerSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} | ||
} |
Oops, something went wrong.