diff --git a/app/controllers/CategoryGuidanceController.scala b/app/controllers/CategoryGuidanceController.scala index 6e51d28ce..891efed81 100644 --- a/app/controllers/CategoryGuidanceController.scala +++ b/app/controllers/CategoryGuidanceController.scala @@ -36,4 +36,9 @@ class CategoryGuidanceController @Inject()( implicit request => Ok(view()) } + + // TODO replace index route + def onSubmit: Action[AnyContent] = (identify andThen getData) { implicit request => + Redirect(routes.IndexController.onPageLoad.url) + } } diff --git a/app/views/CategoryGuidanceView.scala.html b/app/views/CategoryGuidanceView.scala.html index 1beed2045..d58642581 100644 --- a/app/views/CategoryGuidanceView.scala.html +++ b/app/views/CategoryGuidanceView.scala.html @@ -16,7 +16,8 @@ @this( layout: templates.Layout, - govukButton: GovukButton + govukButton: GovukButton, + formHelper: FormWithCSRF ) @()(implicit request: Request[_], messages: Messages) @@ -24,4 +25,15 @@ @layout(pageTitle = titleNoForm(messages("categoryGuidance.title"))) {

@messages("categoryGuidance.heading")

+

@messages("categoryGuidance.p1")

+

@messages("categoryGuidance.p2")

+

@messages("categoryGuidance.p3")

+

@messages("categoryGuidance.p4")

+

@messages("categoryGuidance.p5")

+ + @formHelper(action = CategoryGuidanceController.onSubmit) { + @govukButton( + ButtonViewModel(messages("site.continue")) + ) + } } diff --git a/conf/app.routes b/conf/app.routes index bf578cb57..a7bc450c1 100644 --- a/conf/app.routes +++ b/conf/app.routes @@ -49,7 +49,8 @@ POST /ukims-number controllers.UkimsNumber GET /ukims-number/check controllers.UkimsNumberController.onPageLoad(mode: Mode = CheckMode) POST /ukims-number/check controllers.UkimsNumberController.onSubmit(mode: Mode = CheckMode) -GET /categoryGuidance controllers.CategoryGuidanceController.onPageLoad() +GET /categorisation-start controllers.CategoryGuidanceController.onPageLoad() +POST /categorisation-start controllers.CategoryGuidanceController.onSubmit GET /commodityCode controllers.CommodityCodeController.onPageLoad(mode: Mode = NormalMode) POST /commodityCode controllers.CommodityCodeController.onSubmit(mode: Mode = NormalMode) diff --git a/conf/messages.en b/conf/messages.en index 70f37ad1f..58fc77248 100644 --- a/conf/messages.en +++ b/conf/messages.en @@ -127,8 +127,13 @@ ukimsNumber.error.invalidFormat = Enter your UKIMS number in the correct format ukimsNumber.checkYourAnswersLabel = UKIMS Number ukimsNumber.change.hidden = UKIMS Number -categoryGuidance.title = categoryGuidance -categoryGuidance.heading = categoryGuidance +categoryGuidance.title = Categorisation +categoryGuidance.heading = Categorisation +categoryGuidance.p1 = Categorisation allows you to know what category your goods are in and if they are eligible for Simplified Process for Internal Market Movements (SPIMM). By completing the categorisation journey, you can improve the category of your goods if you hold certain waivers. +categoryGuidance.p2 = We’ll ask you questions about waivers that you hold and then tell you what category your goods are. If the commodity code has too many waivers for us to list, we might ask you for an 8 or 10 digit commodity code. +categoryGuidance.p3 = You’ll need to know the certificate number or name of any waivers you have for your goods. If you get a new waiver, you’ll be able to change this later. +categoryGuidance.p4 = Certain types of goods are excluded and may not be suitable for movement using SPIMM. These goods are referred to as Category 1 goods. Other goods may be controlled and require additional commodity code details to use the SPIMM. These goods are referred to as Category 2 goods. Any goods not classes as Category 1 or Category 2 goods are referred to as Standard goods and can benefit from SPIMM. +categoryGuidance.p5 = You’ll need to know the certificate number or name of any waivers you have for your goods. For example, your certificate number could be either C644, Y929 or C640. If you get a new waiver, you’ll be able to change this later. commodityCode.title = commodityCode commodityCode.heading = commodityCode diff --git a/test/controllers/CategoryGuidanceControllerSpec.scala b/test/controllers/CategoryGuidanceControllerSpec.scala index 5a2e1815f..1c6c9e728 100644 --- a/test/controllers/CategoryGuidanceControllerSpec.scala +++ b/test/controllers/CategoryGuidanceControllerSpec.scala @@ -40,5 +40,20 @@ class CategoryGuidanceControllerSpec extends SpecBase { contentAsString(result) mustEqual view()(request, messages(application)).toString } } + + "must redirect to the categorisation page when the user click continue button" in { + + val application = applicationBuilder().build() + + running(application) { + val request = FakeRequest(POST, routes.CategoryGuidanceController.onSubmit.url) + + val result = route(application, request).value + + status(result) mustEqual SEE_OTHER + // TODO replace index route + redirectLocation(result).value mustEqual routes.IndexController.onPageLoad.url + } + } } }