Skip to content

Commit

Permalink
Merge pull request #7 from hmrc/MIBM-81
Browse files Browse the repository at this point in the history
[MIBM-81][JR] Navigation
  • Loading branch information
PaulHodgson authored Sep 24, 2020
2 parents 16e5215 + 650fabe commit 2d1e8a4
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GoodsDestinationController @Inject()(
.bindFromRequest()
.fold(
formWithErrors => BadRequest(view(formWithErrors)),
value => Ok
value => Redirect(routes.SkeletonJourneyController.valueWeightOfGoods())
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,70 +23,62 @@ class SkeletonJourneyController @Inject()(mcc: MessagesControllerComponents, pag
extends FrontendController(mcc) {

val start: Action[AnyContent] = Action { implicit request =>
Ok(page(s"start.title", routes.SkeletonJourneyController.importExport()))
Ok(page(s"start.title", routes.SkeletonJourneyController.selectDeclarationType()))
}

val importExport: Action[AnyContent] = Action { implicit request =>
Ok(page(s"importExport.title", routes.SkeletonJourneyController.multipleCountriesEuCheck()))
val selectDeclarationType: Action[AnyContent] = Action { implicit request =>
Ok(page(s"selectDeclarationType.title", routes.SkeletonJourneyController.exciseAndRestrictedGoods()))
}

val multipleCountriesEuCheck: Action[AnyContent] = Action { implicit request =>
Ok(page(s"multipleCountriesEuCheck.title", routes.SkeletonJourneyController.goodsExcise()))
}

val goodsExcise: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsExcise.title", routes.SkeletonJourneyController.valueWeightOfGoods()))
val exciseAndRestrictedGoods: Action[AnyContent] = Action { implicit request =>
Ok(page(s"exciseAndRestrictedGoods.title", routes.GoodsDestinationController.onPageLoad()))
}

val valueWeightOfGoods: Action[AnyContent] = Action { implicit request =>
Ok(page(s"valueWeightOfGoods.title", routes.SkeletonJourneyController.goodsType()))
}

val goodsType: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsType.title", routes.SkeletonJourneyController.goodsCategory()))
Ok(page(s"valueWeightOfGoods.title", routes.SkeletonJourneyController.searchGoods()))
}

val goodsCategory: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsCategory.title", routes.SkeletonJourneyController.goodsDetailsWhere()))
val searchGoods: Action[AnyContent] = Action { implicit request =>
Ok(page(s"searchGoods.title", routes.SkeletonJourneyController.searchGoodsCountry()))
}

val goodsDetailsWhere: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsDetailsWhere.title", routes.SkeletonJourneyController.goodsDetailsCost()))
val searchGoodsCountry: Action[AnyContent] = Action { implicit request =>
Ok(page(s"searchGoodsCountry.title", routes.SkeletonJourneyController.purchaseDetails()))
}

val goodsDetailsCost: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsDetailsCost.title", routes.SkeletonJourneyController.goodsReview()))
val purchaseDetails: Action[AnyContent] = Action { implicit request =>
Ok(page(s"purchaseDetails.title", routes.SkeletonJourneyController.reviewGoods()))
}

val goodsReview: Action[AnyContent] = Action { implicit request =>
Ok(page(s"goodsReview.title", routes.SkeletonJourneyController.calculation()))
val reviewGoods: Action[AnyContent] = Action { implicit request =>
Ok(page(s"reviewGoods.title", routes.SkeletonJourneyController.taxCalculation()))
}

val calculation: Action[AnyContent] = Action { implicit request =>
Ok(page(s"calculation.title", routes.SkeletonJourneyController.traderAgent()))
val taxCalculation: Action[AnyContent] = Action { implicit request =>
Ok(page(s"taxCalculation.title", routes.SkeletonJourneyController.customsAgent()))
}

val traderAgent: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderAgent.title", routes.SkeletonJourneyController.traderDetails()))
val customsAgent: Action[AnyContent] = Action { implicit request =>
Ok(page(s"customsAgent.title", routes.SkeletonJourneyController.traderDetails()))
}

val traderDetails: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderDetails.title", routes.SkeletonJourneyController.traderAddress()))
Ok(page(s"traderDetails.title", routes.SkeletonJourneyController.enterTraderAddress()))
}

val traderAddress: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderAddress.title", routes.SkeletonJourneyController.traderAddressList()))
val enterTraderAddress: Action[AnyContent] = Action { implicit request =>
Ok(page(s"enterTraderAddress.title", routes.SkeletonJourneyController.selectTraderAddress()))
}

val traderAddressList: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderAddressList.title", routes.SkeletonJourneyController.traderEori()))
val selectTraderAddress: Action[AnyContent] = Action { implicit request =>
Ok(page(s"selectTraderAddress.title", routes.SkeletonJourneyController.enterEoriNumber()))
}

val traderEori: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderEori.title", routes.SkeletonJourneyController.traderJourney()))
val enterEoriNumber: Action[AnyContent] = Action { implicit request =>
Ok(page(s"enterEoriNumber.title", routes.SkeletonJourneyController.traderJourneyDetails()))
}

val traderJourney: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderJourney.title", routes.CheckYourAnswersController.onPageLoad()))
val traderJourneyDetails: Action[AnyContent] = Action { implicit request =>
Ok(page(s"traderJourneyDetails.title", routes.CheckYourAnswersController.onPageLoad()))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ object GoodsDestination extends Enumerable.Implicits {

implicit val enumerable: Enumerable[GoodsDestination] =
Enumerable(values.map(v => v.toString -> v): _*)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
@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"))
@button(messages("site.continue"), href = Some(next.url))
}
26 changes: 12 additions & 14 deletions conf/app.routes
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@ GET /payment uk.gov.hmrc.merchandiseinbaggagefronten
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 /select-declaration-type uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.selectDeclarationType
GET /excise-and-restricted-goods uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.exciseAndRestrictedGoods
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 /search-goods uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.searchGoods
GET /search-goods-country uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.searchGoodsCountry
GET /purchase-details uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.purchaseDetails
GET /review-goods uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.reviewGoods
GET /tax-calculation uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.taxCalculation
GET /customs-agent uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.customsAgent
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 /enter-trader-address uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.enterTraderAddress
GET /select-trader-address uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.selectTraderAddress
GET /enter-eori-number uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.enterEoriNumber
GET /trader-journey-details uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.SkeletonJourneyController.traderJourneyDetails

# GoodsDestination
GET /goods-destination uk.gov.hmrc.merchandiseinbaggagefrontend.controllers.GoodsDestinationController.onPageLoad()
Expand Down
30 changes: 14 additions & 16 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,20 @@ 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?
selectDeclarationType.title = What do you need to declare?
exciseAndRestrictedGoods.title = Are you bringing in excise goods or restricted goods?
valueWeightOfGoods.title = Is the total value of the goods over £1500 or 1000kg?
searchGoods.title = What goods are you bringing into the UK?
searchGoodsCountry.title = In what country did you buy the x?
purchaseDetails.title = How much did you pay for the x?
reviewGoods.title = Review your goods
taxCalculation.title = Tax due on these goods £x
customsAgent.title = Are you a customs agent?
traderDetails.title = Enter the name of the person carrying the goods
enterTraderAddress.title = Find your address
selectTraderAddress.title = Select your address
enterEoriNumber.title = What is your EORI number?
traderJourneyDetails.title = Journey Details
checkYourAnswers.title = Check your answers before making your declaration


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ class GoodsDestinationControllerSpec extends BaseSpecWithApplication {
}

//TODO assert against redirection/storage when MIBM-77 done
"return OK when valid selection submitted" in {
"Redirect to /value-weight-of-goods when valid selection submitted" in {
val request = FakeRequest(POST, route).withCSRFToken
.asInstanceOf[FakeRequest[AnyContentAsEmpty.type]]
.withFormUrlEncodedBody(("value", "ni"))

val submittedForm = form.bindFromRequest()(request)

val result = controller.onSubmit()(request)

status(result) mustEqual OK
status(result) mustEqual SEE_OTHER
redirectLocation(result).get mustEqual routes.SkeletonJourneyController.valueWeightOfGoods().toString
}

"return BAD_REQUEST and errors when no selection made" in {
Expand Down
Loading

0 comments on commit 2d1e8a4

Please sign in to comment.