diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementController.scala index 742ceed4..43915ef9 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementController.scala @@ -36,9 +36,10 @@ import uk.gov.hmrc.ngrraldfrontend.views.html.AgreementView import uk.gov.hmrc.ngrraldfrontend.views.html.components.{DateTextFields, NGRCharacterCountComponent} import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class AgreementController @Inject()(view: AgreementView, authenticate: AuthRetrievals, dateTextFields: DateTextFields, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementVerbalController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementVerbalController.scala index 7cc49612..9143ceb1 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementVerbalController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/AgreementVerbalController.scala @@ -37,9 +37,10 @@ import uk.gov.hmrc.ngrraldfrontend.views.html.AgreementVerbalView import uk.gov.hmrc.ngrraldfrontend.views.html.components.DateTextFields import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class AgreementVerbalController @Inject()(view: AgreementVerbalView, authenticate: AuthRetrievals, hasLinkedProperties: PropertyLinkingAction, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/CheckRentFreePeriodController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/CheckRentFreePeriodController.scala index 013bc56c..33139e8a 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/CheckRentFreePeriodController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/CheckRentFreePeriodController.scala @@ -30,9 +30,10 @@ import uk.gov.hmrc.ngrraldfrontend.repo.RaldRepo import uk.gov.hmrc.ngrraldfrontend.views.html.CheckRentFreePeriodView import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class CheckRentFreePeriodController @Inject()(checkRentFreePeriodView: CheckRentFreePeriodView, authenticate : AuthRetrievals, hasLinkedProperties: PropertyLinkingAction, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/HowMuchIsTotalAnnualRentController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/HowMuchIsTotalAnnualRentController.scala index a95ce3e6..9ff1263b 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/HowMuchIsTotalAnnualRentController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/HowMuchIsTotalAnnualRentController.scala @@ -29,9 +29,10 @@ import uk.gov.hmrc.ngrraldfrontend.repo.RaldRepo import uk.gov.hmrc.ngrraldfrontend.views.html.HowMuchIsTotalAnnualRentView import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class HowMuchIsTotalAnnualRentController @Inject()(howMuchIsTotalAnnualRentView: HowMuchIsTotalAnnualRentView, authenticate: AuthRetrievals, hasLinkedProperties: PropertyLinkingAction, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala index 4b63f136..9c21fb5e 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala @@ -34,9 +34,10 @@ import uk.gov.hmrc.ngrraldfrontend.views.html.LandlordView import uk.gov.hmrc.ngrraldfrontend.views.html.components.NGRCharacterCountComponent import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class LandlordController @Inject()(view: LandlordView, authenticate: AuthRetrievals, hasLinkedProperties: PropertyLinkingAction, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/ProvideDetailsOfFirstSecondRentPeriodController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/ProvideDetailsOfFirstSecondRentPeriodController.scala index c80aa212..05f15ac6 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/ProvideDetailsOfFirstSecondRentPeriodController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/ProvideDetailsOfFirstSecondRentPeriodController.scala @@ -36,9 +36,10 @@ import uk.gov.hmrc.ngrraldfrontend.views.html.ProvideDetailsOfFirstSecondRentPer import uk.gov.hmrc.ngrraldfrontend.views.html.components.InputText import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class ProvideDetailsOfFirstSecondRentPeriodController @Inject()(view: ProvideDetailsOfFirstSecondRentPeriodView, authenticate: AuthRetrievals, inputText: InputText, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/RentPeriodsController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/RentPeriodsController.scala new file mode 100644 index 00000000..e21dd8d4 --- /dev/null +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/RentPeriodsController.scala @@ -0,0 +1,185 @@ +/* + * Copyright 2025 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 uk.gov.hmrc.ngrraldfrontend.controllers + +import play.api.i18n.{I18nSupport, Messages} +import play.api.mvc.{Action, AnyContent, MessagesControllerComponents} +import uk.gov.hmrc.govukfrontend.views.Aliases.Text +import uk.gov.hmrc.govukfrontend.views.viewmodels.* +import uk.gov.hmrc.govukfrontend.views.viewmodels.table.{Table, TableRow} +import uk.gov.hmrc.http.NotFoundException +import uk.gov.hmrc.ngrraldfrontend.actions.{AuthRetrievals, PropertyLinkingAction} +import uk.gov.hmrc.ngrraldfrontend.config.AppConfig +import uk.gov.hmrc.ngrraldfrontend.models.RaldUserAnswers +import uk.gov.hmrc.ngrraldfrontend.models.components.NGRRadio +import uk.gov.hmrc.ngrraldfrontend.models.components.NGRRadio.buildRadios +import uk.gov.hmrc.ngrraldfrontend.models.components.NavBarPageContents.createDefaultNavBar +import uk.gov.hmrc.ngrraldfrontend.models.forms.RentPeriodsForm +import uk.gov.hmrc.ngrraldfrontend.models.forms.RentPeriodsForm.form +import uk.gov.hmrc.ngrraldfrontend.models.registration.CredId +import uk.gov.hmrc.ngrraldfrontend.repo.RaldRepo +import uk.gov.hmrc.ngrraldfrontend.views.html.RentPeriodView +import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController + +import javax.inject.{Inject, Singleton} +import scala.concurrent.{ExecutionContext, Future} + +@Singleton +class RentPeriodsController @Inject()(view: RentPeriodView, + authenticate: AuthRetrievals, + hasLinkedProperties: PropertyLinkingAction, + raldRepo: RaldRepo, + mcc: MessagesControllerComponents + )(implicit appConfig: AppConfig, ec:ExecutionContext) extends FrontendController(mcc) with I18nSupport { + + def firstTable(userAnswers: RaldUserAnswers)(implicit messages:Messages): Table = + Table( + rows = Seq( + Seq( + TableRow( + content = Text(messages("rentPeriods.first.startDate")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map{ dates => + dates.firstDateStart + }.getOrElse("")) + ) + ), + Seq( + TableRow( + content = Text(messages("rentPeriods.first.endDate")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map{ dates => + dates.firstDateEnd + }.getOrElse("")) + ) + ), + if(userAnswers.provideDetailsOfFirstSecondRentPeriod.nonEmpty){ + Seq( + TableRow( + content = Text(messages("rentPeriods.first.rentValue")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map { dates => + dates.firstRentPeriodAmount.get + }.getOrElse("")) + ) + ) + }else(Seq()), + Seq( + TableRow( + content = Text(messages("rentPeriods.first.doYouPay")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map{ dates => + if(dates.firstRentPeriodRadio == true){ + "Yes" + }else{"False"} + }.getOrElse("")) + ) + ) + ), + head = None, + caption = Some(Messages("rentPeriods.first.subheading")), + captionClasses = "govuk-table__caption--m", + firstCellIsHeader = true + ) + + def secondTable(userAnswers: RaldUserAnswers)(implicit messages: Messages): Table = Table( + rows = Seq( + Seq( + TableRow( + content = Text(messages("rentPeriods.second.startDate")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map{ dates => + dates.secondDateStart + }.getOrElse("")) + ) + ), + Seq( + TableRow( + content = Text(messages("rentPeriods.second.endDate")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map { dates => + dates.secondDateEnd + }.getOrElse("")) + ) + ), + Seq( + TableRow( + content = Text(messages("rentPeriods.second.rentValue")) + ), + TableRow( + content = Text(userAnswers.provideDetailsOfFirstSecondRentPeriod.map { dates => + dates.firstRentPeriodAmount.get + }.getOrElse("")) + ) + ) + ), + head = None, + caption = Some(Messages("rentPeriods.first.subheading")), + captionClasses = "govuk-table__caption--m", + firstCellIsHeader = true + ) + + def show: Action[AnyContent] = { + (authenticate andThen hasLinkedProperties).async { implicit request => + raldRepo.findByCredId(CredId(request.credId.getOrElse(""))).flatMap { + case Some(answers: RaldUserAnswers) => + Future.successful(Ok(view( + navigationBarContent = createDefaultNavBar, + selectedPropertyAddress = answers.selectedProperty.addressFull, + form, + firstTable = firstTable(answers), + secondTable = secondTable(answers), + ngrRadio = buildRadios(form, RentPeriodsForm.ngrRadio(form))))) + case None => + throw new NotFoundException("Couldn't find user Answers") + } + } + } + + def submit: Action[AnyContent] = { + (authenticate andThen hasLinkedProperties).async { implicit request => + form + .bindFromRequest() + .fold( + formWithErrors => + raldRepo.findByCredId(CredId(request.credId.getOrElse(""))).flatMap { + case Some(answers: RaldUserAnswers) => + Future.successful(BadRequest(view( + navigationBarContent = createDefaultNavBar, + selectedPropertyAddress = answers.selectedProperty.addressFull, + formWithErrors, + firstTable = firstTable(answers), + secondTable = secondTable(answers), + buildRadios(formWithErrors, RentPeriodsForm.ngrRadio(formWithErrors))))) + case None => throw new NotFoundException("Couldn't find user Answers") + }, + rentPeriodsForm => + raldRepo.insertRentPeriod( + CredId(request.credId.getOrElse("")), + rentPeriodsForm.radioValue + ) + Future.successful(Redirect(routes.WhatTypeOfAgreementController.show.url)) + ) + } + } +} diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/WhatIsYourRentBasedOnController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/WhatIsYourRentBasedOnController.scala index 4efa961b..aac45d1d 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/WhatIsYourRentBasedOnController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/WhatIsYourRentBasedOnController.scala @@ -34,9 +34,10 @@ import uk.gov.hmrc.ngrraldfrontend.views.html.WhatIsYourRentBasedOnView import uk.gov.hmrc.ngrraldfrontend.views.html.components.NGRCharacterCountComponent import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController -import javax.inject.Inject +import javax.inject.{Inject, Singleton} import scala.concurrent.{ExecutionContext, Future} +@Singleton class WhatIsYourRentBasedOnController @Inject()(view: WhatIsYourRentBasedOnView, authenticate: AuthRetrievals, hasLinkedProperties: PropertyLinkingAction, diff --git a/app/uk/gov/hmrc/ngrraldfrontend/models/forms/RentPeriodsForm.scala b/app/uk/gov/hmrc/ngrraldfrontend/models/forms/RentPeriodsForm.scala new file mode 100644 index 00000000..a86fd36b --- /dev/null +++ b/app/uk/gov/hmrc/ngrraldfrontend/models/forms/RentPeriodsForm.scala @@ -0,0 +1,67 @@ +/* + * Copyright 2025 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 uk.gov.hmrc.ngrraldfrontend.models.forms +/* + * Copyright 2025 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. + */ + +import play.api.data.Form +import play.api.data.Forms.mapping +import play.api.i18n.Messages +import play.api.libs.json.{Json, OFormat} +import uk.gov.hmrc.govukfrontend.views.Aliases.{Legend, Text} +import uk.gov.hmrc.ngrraldfrontend.models.components.* +import uk.gov.hmrc.ngrraldfrontend.models.forms.mappings.Mappings + +final case class RentPeriodsForm(radioValue: String) + +object RentPeriodsForm extends Mappings { + implicit val format: OFormat[RentPeriodsForm] = Json.format[RentPeriodsForm] + + private lazy val radioUnselectedError = "rentPeriods.error.required" + private val rentPeriodsRadio = "rent-periods-radio" + + def unapply(rentPeriodsForm: RentPeriodsForm): Option[String] = Some(rentPeriodsForm.radioValue) + + def form: Form[RentPeriodsForm] = { + Form( + mapping( + rentPeriodsRadio -> text(radioUnselectedError) + )(RentPeriodsForm.apply)(RentPeriodsForm.unapply) + ) + } + + private val yes: NGRRadioButtons = NGRRadioButtons(radioContent = "rentPeriods.yes", radioValue = No) + private val no: NGRRadioButtons = NGRRadioButtons(radioContent = "rentPeriods.no", radioValue = Yes) + + def ngrRadio(form: Form[RentPeriodsForm])(implicit messages: Messages): NGRRadio = + NGRRadio(ngrTitle = Some(Legend(content = Text(messages("rentPeriods.radio.heading")), classes = "govuk-fieldset__legend--m", isPageHeading = true)), radioGroupName = NGRRadioName("rent-periods-radio"), NGRRadioButtons = Seq(yes, no)) + +} + diff --git a/app/uk/gov/hmrc/ngrraldfrontend/repo/RaldRepo.scala b/app/uk/gov/hmrc/ngrraldfrontend/repo/RaldRepo.scala index 45a1a2f6..38f76aa2 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/repo/RaldRepo.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/repo/RaldRepo.scala @@ -125,30 +125,33 @@ case class RaldRepo @Inject()(mongo: MongoComponent, } def insertProvideDetailsOfFirstSecondRentPeriod( - credId: CredId, - firstDateStart: String, - firstDateEnd: String, - firstRentPeriodRadio: String, - firstRentPeriodAmount: Option[BigDecimal], - secondDateStart: String, - secondDateEnd: String, - secondHowMuchIsRent: BigDecimal - ): Future[Option[RaldUserAnswers]] = { - val firstDateStartVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstDateStart", firstDateStart) - val firstDateEndVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstDateEnd", firstDateEnd) - val firstRentPeriodRadioVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstRentPeriodRadio", firstRentPeriodRadio match { - case answer if (answer == "yesPayedRent") => true - case _ => false - }) - val firstRentPeriodAmountVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstRentPeriodAmount", firstRentPeriodAmount match { - case Some(value) => value.toString() - case _ => null - }) - val secondDateStartVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondDateStart", secondDateStart) - val secondDateEndVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondDateEnd", secondDateEnd) - val secondHowMuchIsRentVal = Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondHowMuchIsRent", secondHowMuchIsRent.toString) - val answers = Seq(firstDateStartVal, firstDateEndVal, firstRentPeriodRadioVal, firstRentPeriodAmountVal, secondDateStartVal, secondDateEndVal, secondHowMuchIsRentVal) - findAndUpdateByCredId(credId = credId, answers: _*) + credId: CredId, + firstDateStart: String, + firstDateEnd: String, + firstRentPeriodRadio: String, + firstRentPeriodAmount: Option[BigDecimal], + secondDateStart: String, + secondDateEnd: String, + secondHowMuchIsRent: BigDecimal + ): Future[Option[RaldUserAnswers]] = { + + val updates = Seq( + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstDateStart", firstDateStart), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstDateEnd", firstDateEnd), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstRentPeriodRadio", firstRentPeriodRadio match { + case answer if (answer == "yesPayedRent") => true + case _ => false + }), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.firstRentPeriodAmount", firstRentPeriodAmount match { + case Some(value) => value.toString() + case _ => null + }), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondDateStart", secondDateStart), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondDateEnd", secondDateEnd), + Updates.set("ProvideDetailsOfFirstSecondRentPeriod.secondHowMuchIsRent", secondHowMuchIsRent.toString) + ) + + findAndUpdateByCredId(credId, updates: _*) } def insertRentBased(credId: CredId, rentBased: String, rentBasedOtherText:Option[String]): Future[Option[RaldUserAnswers]] = { @@ -189,6 +192,14 @@ case class RaldRepo @Inject()(mongo: MongoComponent, } + def insertRentPeriod(credId: CredId, hasAnotherRentPeriod: String): Future[Option[RaldUserAnswers]] = { + hasAnotherRentPeriod match { + case "Yes" => findAndUpdateByCredId(credId, Updates.set("hasAnotherRentPeriod", true)) + case _ => findAndUpdateByCredId(credId, Updates.set("hasAnotherRentPeriod", false)) + } + + } + def findByCredId(credId: CredId): Future[Option[RaldUserAnswers]] = { collection.find( equal("credId.value", credId.value) diff --git a/app/uk/gov/hmrc/ngrraldfrontend/views/RentPeriodView.scala.html b/app/uk/gov/hmrc/ngrraldfrontend/views/RentPeriodView.scala.html new file mode 100644 index 00000000..b39d991b --- /dev/null +++ b/app/uk/gov/hmrc/ngrraldfrontend/views/RentPeriodView.scala.html @@ -0,0 +1,50 @@ +@* + * Copyright 2025 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. + *@ + +@import uk.gov.hmrc.ngrraldfrontend.config.AppConfig +@import uk.gov.hmrc.ngrraldfrontend.models.components.NavigationBarContent +@import uk.gov.hmrc.ngrraldfrontend.viewmodels.govuk.all._ +@import uk.gov.hmrc.govukfrontend.views.html.components._ +@import uk.gov.hmrc.ngrraldfrontend.views.html.components._ +@import uk.gov.hmrc.ngrraldfrontend.models.forms.RentPeriodsForm +@import uk.gov.hmrc.govukfrontend.views.html.components._ + +@this( + layout: Layout, + govukErrorSummary: GovukErrorSummary, + govukRadios : GovukRadios, + saveAndContinueButton: saveAndContinueButton, + formHelper: FormWithCSRF, + govukTable : GovukTable +) + +@(navigationBarContent: NavigationBarContent, selectedPropertyAddress: String, form: Form[RentPeriodsForm], firstTable: Table, secondTable: Table, ngrRadio: Radios)(implicit request: RequestHeader, messages: Messages, appConfig: AppConfig) + +@layout(pageTitle = Some(messages("rentPeriods.title")), showBackLink = true, fullWidth = false, navigationBarContent = Some(navigationBarContent)) { + + @formHelper(action = uk.gov.hmrc.ngrraldfrontend.controllers.routes.RentPeriodsController.submit, Symbol("autoComplete") -> "off") { + @if(form.errors.nonEmpty) { + @govukErrorSummary(ErrorSummaryViewModel(form)) + } + @selectedPropertyAddress +