Skip to content

Commit

Permalink
Merge pull request #189 from hmrc/PODS-9186
Browse files Browse the repository at this point in the history
PODS-9186: Non UK registration change
  • Loading branch information
ngmjohnstone authored Mar 8, 2024
2 parents 02f45e7 + 39f8e70 commit fb6ccce
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class AreYouUKResidentController @Inject()(override val messagesApi: MessagesApi
"submitUrl" -> routes.AreYouUKResidentController.onSubmit(mode).url,
"radios" -> Radios.yesNo(formWithErrors("value"))
)

renderer.render("individual/areYouUKResident.njk", json).map(BadRequest(_))
},
value =>
Expand Down
44 changes: 44 additions & 0 deletions app/controllers/individual/NonUKPractitionerController.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package controllers.individual

import controllers.Retrievals
import controllers.actions._
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.libs.json.Json
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import renderer.Renderer
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import utils.annotations.AuthMustHaveNoEnrolmentWithIV

import javax.inject.Inject
import scala.concurrent.ExecutionContext

class NonUKPractitionerController @Inject()(
override val messagesApi: MessagesApi,
@AuthMustHaveNoEnrolmentWithIV authenticate: AuthAction,
getData: DataRetrievalAction,
val controllerComponents: MessagesControllerComponents,
renderer: Renderer
)(implicit ec: ExecutionContext) extends FrontendBaseController
with I18nSupport with Retrievals {

def onPageLoad: Action[AnyContent] = (authenticate andThen getData).async {
implicit request =>
renderer.render(template = "individual/nonUKPractitioner.njk", Json.obj()).map(Ok(_))
}
}
2 changes: 1 addition & 1 deletion app/navigators/IndividualNavigator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class IndividualNavigator @Inject()(countryOptions: CountryOptions) extends Navi
case AreYouUKResidentPage =>
ua.get(AreYouUKResidentPage) match {
case Some(true) => IsThisYouController.onPageLoad(NormalMode)
case Some(false) => IndividualNameController.onPageLoad(NormalMode)
case Some(false) => NonUKPractitionerController.onPageLoad()
case _ => controllers.routes.SessionExpiredController.onPageLoad()
}
case IndividualDetailsPage => IndividualEnterRegisteredAddressController.onPageLoad(NormalMode)
Expand Down
2 changes: 1 addition & 1 deletion conf/individual.routes
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ GET /change-address-manual controllers.indi
POST /change-address-manual controllers.individual.IndividualEnterRegisteredAddressController.onSubmit(mode: Mode = CheckMode)

GET /outside-eu-eea controllers.individual.OutsideEuEeaController.onPageLoad()

GET /non-uk-practitioner controllers.individual.NonUKPractitionerController.onPageLoad()
8 changes: 8 additions & 0 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ outsideEuEea.title = You cannot register as a PSP
outsideEuEea.p1 = This is because you are based in {0} and outside of the European Union and European Economic Area.
outsideEuEea.p2 = Only people based inside the European Union and European Economic Area can register as a PSP.

nonUKPractitioner.title = You cannot register as a scheme practitioner
nonUKPractitioner.heading = You cannot register as a scheme practitioner
nonUKPractitioner.p1 = You must be a UK resident.
nonUKPractitioner.p2.1 = To register, email
nonUKPractitioner.p2.email = administrationpensions@hmrc.gov.uk
nonUKPractitioner.p2.emailHref = administrationpensions@hmrc.gov.uk?subject=Non-UK
nonUKPractitioner.p2.2 = and include ‘Non-UK’ in the title.

businessRegistrationType.title = What is the business registered as?
businessRegistrationType.heading = What is the business registered as?
businessRegistrationType.company = Company
Expand Down
38 changes: 38 additions & 0 deletions conf/views/individual/nonUKPractitioner.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "includes/layout.njk" %}

{% from "macros/title.njk" import title %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}


{% block pageTitle %}
{{ title(messages("nonUKPractitioner.title")) }}
{% endblock %}

{% block mainContent %}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h1 class="govuk-heading-xl">
{{ messages("nonUKPractitioner.heading") }}
</h1>

<p class="govuk-body">
{{ messages("nonUKPractitioner.p1") }}
</p>

<p class="govuk-body">
{{ messages("nonUKPractitioner.p2.1") }}
<a href="mailto:{{ messages("nonUKPractitioner.p2.emailHref") }}">
{{ messages("nonUKPractitioner.p2.email") }}
</a>
{{ messages("nonUKPractitioner.p2.2") }}
</p>

</div>
</div>



{% endblock %}
2 changes: 1 addition & 1 deletion test/navigators/IndividualNavigatorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IndividualNavigatorSpec extends NavigatorBehaviour {
("Id", "UserAnswers", "Next Page"),
row(WhatYouWillNeedPage)(controllers.individual.routes.AreYouUKResidentController.onPageLoad(NormalMode)),
row(AreYouUKResidentPage)(controllers.individual.routes.IsThisYouController.onPageLoad(NormalMode), Some(areYouUKResident(true))),
row(AreYouUKResidentPage)(controllers.individual.routes.IndividualNameController.onPageLoad(NormalMode), Some(areYouUKResident(false))),
row(AreYouUKResidentPage)(controllers.individual.routes.NonUKPractitionerController.onPageLoad(), Some(areYouUKResident(false))),
row(AreYouUKResidentPage)(controllers.routes.SessionExpiredController.onPageLoad(), None),
row(IndividualDetailsPage)(controllers.individual.routes.IndividualEnterRegisteredAddressController.onPageLoad(NormalMode), None),
row(IndividualAddressPage)(controllers.individual.routes.UseAddressForContactController.onPageLoad(NormalMode), Some(uaAddress("FR"))),
Expand Down

0 comments on commit fb6ccce

Please sign in to comment.