Skip to content

Commit

Permalink
Merge pull request #59 from hmrc/CategoryGuidance-content
Browse files Browse the repository at this point in the history
Category guidance content
  • Loading branch information
yohan-oc authored May 14, 2024
2 parents 9108d00 + e8d89fe commit d4014c1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/controllers/CategoryGuidanceController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
14 changes: 13 additions & 1 deletion app/views/CategoryGuidanceView.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@

@this(
layout: templates.Layout,
govukButton: GovukButton
govukButton: GovukButton,
formHelper: FormWithCSRF
)

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

@layout(pageTitle = titleNoForm(messages("categoryGuidance.title"))) {

<h1 class="govuk-heading-xl">@messages("categoryGuidance.heading")</h1>
<p class="govuk-body">@messages("categoryGuidance.p1")</p>
<p class="govuk-body">@messages("categoryGuidance.p2")</p>
<p class="govuk-body">@messages("categoryGuidance.p3")</p>
<p class="govuk-body">@messages("categoryGuidance.p4")</p>
<p class="govuk-body">@messages("categoryGuidance.p5")</p>

@formHelper(action = CategoryGuidanceController.onSubmit) {
@govukButton(
ButtonViewModel(messages("site.continue"))
)
}
}
3 changes: 2 additions & 1 deletion conf/app.routes
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions test/controllers/CategoryGuidanceControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}

0 comments on commit d4014c1

Please sign in to comment.