diff --git a/app/controllers/verify/VerificationRequestSubmittedController.scala b/app/controllers/verify/VerificationRequestSubmittedController.scala new file mode 100644 index 00000000..203455d6 --- /dev/null +++ b/app/controllers/verify/VerificationRequestSubmittedController.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2026 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.verify + +import config.FrontendAppConfig +import controllers.actions.* +import play.api.i18n.{I18nSupport, MessagesApi} +import play.api.mvc.{Action, AnyContent, MessagesControllerComponents} +import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController +import viewmodels.checkAnswers.verify.VerificationRequestSubmittedViewModel +import views.html.verify.VerificationRequestSubmittedView +import javax.inject.Inject + +class VerificationRequestSubmittedController @Inject() ( + override val messagesApi: MessagesApi, + identify: IdentifierAction, + getData: DataRetrievalAction, + requireData: DataRequiredAction, + val controllerComponents: MessagesControllerComponents, + view: VerificationRequestSubmittedView +)(implicit appConfig: FrontendAppConfig) + extends FrontendBaseController + with I18nSupport { + + def onPageLoad(): Action[AnyContent] = + (identify andThen getData andThen requireData) { implicit request => + val vm = + VerificationRequestSubmittedViewModel + .fromUserAnswers(request.userAnswers) + Ok(view(vm)) + } +} diff --git a/app/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModel.scala b/app/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModel.scala new file mode 100644 index 00000000..498c6343 --- /dev/null +++ b/app/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModel.scala @@ -0,0 +1,53 @@ +/* + * Copyright 2026 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 viewmodels.checkAnswers.verify +import models.UserAnswers +import pages.verify._ +import java.time.LocalDateTime + +case class VerificationRequestSubmittedViewModel( + referenceNumber: String, + submittedAt: LocalDateTime, + subcontractorsToVerify: Seq[String], + subcontractorsToReverify: Seq[String] = Seq.empty, + confirmationEmail: Option[String] = None +) { + def showEmail: Boolean = confirmationEmail.isDefined + def showVerify: Boolean = subcontractorsToVerify.nonEmpty + def showReverify: Boolean = subcontractorsToReverify.nonEmpty +} + +object VerificationRequestSubmittedViewModel { + + def fromUserAnswers(userAnswers: UserAnswers): VerificationRequestSubmittedViewModel = + VerificationRequestSubmittedViewModel( + // TODO: Replace below with actuals - 1. referenceNumber 2. submittedAt + referenceNumber = "Reference Number 12345", + submittedAt = LocalDateTime.now(), + subcontractorsToVerify = userAnswers + .get(SelectSubcontractorPage) + .getOrElse(Seq.empty) + .map(_.name) + .toSeq, + subcontractorsToReverify = userAnswers + .get(SelectSubcontractorsToReverifyPage) + .getOrElse(Seq.empty) + .map(_.name) + .toSeq, + confirmationEmail = userAnswers.get(EmailAddressPage) + ) +} diff --git a/app/views/components/PrintLink.scala.html b/app/views/components/PrintLink.scala.html new file mode 100644 index 00000000..348ca302 --- /dev/null +++ b/app/views/components/PrintLink.scala.html @@ -0,0 +1,29 @@ +@* + * Copyright 2026 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. + *@ + +@this() + +@(textKey: String, id: String = "print-link", extraClasses: String = "")(implicit messages: play.api.i18n.Messages) + +

+ + @messages(textKey) + +

diff --git a/app/views/verify/VerificationRequestSubmittedView.scala.html b/app/views/verify/VerificationRequestSubmittedView.scala.html new file mode 100644 index 00000000..722261a7 --- /dev/null +++ b/app/views/verify/VerificationRequestSubmittedView.scala.html @@ -0,0 +1,189 @@ +@* + * Copyright 2026 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 config.FrontendAppConfig +@import java.time.LocalDateTime +@import java.time.format.DateTimeFormatter +@import uk.gov.hmrc.govukfrontend.views.viewmodels.panel.Panel +@import uk.gov.hmrc.govukfrontend.views.Aliases.* + +@import uk.gov.hmrc.govukfrontend.views.viewmodels.summarylist._ +@import viewmodels.govuk.summarylist.SummaryListViewModel + +@import views.html.components._ +@import viewmodels.checkAnswers.verify.VerificationRequestSubmittedViewModel + + +@this( + layout: templates.Layout, + govukPanel: GovukPanel, + govukInsetText: GovukInsetText, + govukSummaryList: GovukSummaryList, + heading: H1, + subHeading: H2, + paragraph: Paragraph, + printLink: PrintLink, + link: Link +) + +@(vm: VerificationRequestSubmittedViewModel +)(implicit request: Request[_],appConfig: FrontendAppConfig, messages: Messages) + +@layout(pageTitle = titleNoForm(messages("verify.verificationRequestSubmitted.title")), showBackLink = false) { + + @govukPanel( + Panel( + title = Text(messages("verify.verificationRequestSubmitted.heading")), + content = HtmlContent( + s""" + ${messages("verify.verificationRequestSubmitted.reference")}
+ (${HtmlFormat.escape(vm.referenceNumber)}) + """ + ) + ) + ) + + @paragraph( + messages( + "verify.verificationRequestSubmitted.submittedAt", + vm.submittedAt.format(DateTimeFormatter.ofPattern("HH:mm 'on' dd MMMM yyyy")) + ) + ) + + @subHeading( + messages( + "verify.verificationRequestSubmitted.details.subHeading" + ) + ) + + @if(vm.showVerify) { + @govukSummaryList( + SummaryListViewModel( + rows = Seq( + SummaryListRowViewModel( + key = messages("verify.verificationRequestSubmitted.subcontractorsToVerify.label"), + value = ValueViewModel( + HtmlContent( + if (vm.subcontractorsToVerify.size > 1) { + vm.subcontractorsToVerify + .map(name => s"
  • $name
  • ") + .mkString("") + } else { + vm.subcontractorsToVerify.headOption.getOrElse("") + } + ) + ) + ).withCssClass("govuk-summary-list__row--no-border") + ) + ) + ) + } + + @if(vm.showReverify) { + @govukSummaryList( + SummaryListViewModel( + rows = Seq( + SummaryListRowViewModel( + key = messages("verify.verificationRequestSubmitted.subcontractorsToReverify.label"), + value = ValueViewModel( + HtmlContent( + if (vm.subcontractorsToReverify.size > 1) { + vm.subcontractorsToReverify + .map(name => s"
  • $name
  • ") + .mkString("") + } else { + vm.subcontractorsToReverify.headOption.getOrElse("") + } + ) + ) + ).withCssClass("govuk-summary-list__row--no-border") + ) + ) + ) + } + + + @if(vm.showEmail) { + @vm.confirmationEmail.map { email => + @paragraph( + messages( + "verify.verificationRequestSubmitted.email.confirmation", + {email}, + "verify.verificationRequestSubmitted.fullStop" + ) + ) + } + } + + @link( + linkTextKey = "verify.verificationRequestSubmitted.email.verification.link", + linkUrl = "#", // TODO: Link to be updated later + hasFullStop = true, + prefixTextKey = "verify.verificationRequestSubmitted.email.verification" + ) + + @govukInsetText( + InsetText( + content = HtmlContent( + s""" + ${paragraph(messages("verify.verificationRequestSubmitted.print.text"))} + ${printLink("verify.verificationRequestSubmitted.print.link")} + """ + ) + ) + ) + + @subHeading( + messages( + "verify.verificationRequestSubmitted.needHelp.subHeading") + ) + + @link( + linkTextKey = "verify.verificationRequestSubmitted.needHelp.contactHMRC.link", + linkUrl = appConfig.cisGeneralEnquiries, + hasFullStop = true, + prefixTextKey = "verify.verificationRequestSubmitted.needHelp.p1", + ) + + @paragraph( + messages( + "verify.verificationRequestSubmitted.needHelp.p2" + ) + ) + + @link( + linkTextKey = "verify.verificationRequestSubmitted.needHelp.manageSubcontractors.link", + linkUrl = appConfig.manageSubcontractorsUrl, // TODO: Link to be updated later. + hasFullStop = true, + prefixTextKey = "verify.verificationRequestSubmitted.needHelp.p3", + ) + + @subHeading( + messages("verify.verificationRequestSubmitted.feedback.subHeading") + ) + + @paragraph( + messages( + "verify.verificationRequestSubmitted.feedback.p1" + ) + ) + + @link( + "verify.verificationRequestSubmitted.feedback.survey.link", + appConfig.exitSurveyUrl, // TODO: Link to be confirmed & verified + suffixTextKey = "verify.verificationRequestSubmitted.feedback.p2" + ) +} diff --git a/conf/app.routes b/conf/app.routes index 277d23e8..68599f18 100644 --- a/conf/app.routes +++ b/conf/app.routes @@ -373,7 +373,6 @@ POST /verify/confirmation-email-stored controllers.verify.Contra GET /verify/change-confirmation-email-stored controllers.verify.ContractorEmailConfirmationStoredController.onPageLoad(mode: Mode = CheckMode) POST /verify/change-confirmation-email-stored controllers.verify.ContractorEmailConfirmationStoredController.onSubmit(mode: Mode = CheckMode) - GET /verify/select-subcontractors-to-reverify controllers.verify.SelectSubcontractorsToReverifyController.onPageLoad(mode: Mode = NormalMode, page: Int ?= 1) POST /verify/select-subcontractors-to-reverify controllers.verify.SelectSubcontractorsToReverifyController.onSubmit(mode: Mode = NormalMode, page: Int ?= 1) GET /verify/change-select-subcontractors-to-reverify controllers.verify.SelectSubcontractorsToReverifyController.onPageLoad(mode: Mode = CheckMode, page: Int ?= 1) @@ -398,3 +397,5 @@ GET /verify/no-new-subcontractors-to-verify controllers.verify.Verify POST /verify/no-new-subcontractors-to-verify controllers.verify.VerifyYourSubcontractorsYesNoController.onSubmit GET /verify/problem-with-verification-warning controllers.verify.VerifyDepartmentalErrorController.onPageLoad() + +GET /verify/verification-request-submitted controllers.verify.VerificationRequestSubmittedController.onPageLoad() diff --git a/conf/messages.en b/conf/messages.en index a06ce4cc..02efc581 100644 --- a/conf/messages.en +++ b/conf/messages.en @@ -775,119 +775,136 @@ trustCheckYourAnswers.trailText = By adding this trustCheckYourAnswers.continue = Accept and submit # Verify -verify.submissionSending.title = Submitting your verification request -verify.submissionSending.heading = Your verification request is being sent to HMRC -verify.submissionSending.paragraph = Do not refresh this page or press the back button while your submission is being processed. - -verify.contractorEmailConfirmationNotStored.title = Do you want an email confirmation of this verification request? -verify.contractorEmailConfirmationNotStored.heading = Do you want an email confirmation of this verification request? -verify.contractorEmailConfirmationNotStored.checkYourAnswersLabel = Do you want confirmation by email? -verify.contractorEmailConfirmationNotStored.error.required = Select yes if you want an email confirmation of this verification request -verify.contractorEmailConfirmationNotStored.change.hidden = do you want confirmation by email? - -verify.verificationDeclaration.title = Verification declaration -verify.verificationDeclaration.heading = Declaration -verify.verificationDeclaration.p1 = By submitting this verification request, you confirm that: -verify.verificationDeclaration.list.l1 = a formal arrangement is in place (for example, tender accepted, contract agreed, order placed) for all of the subcontractors to be verified in this request. -verify.verificationDeclaration.list.l2 = the information given in this verification request is correct and complete to the best of your knowledge and belief. -verify.verificationDeclaration.warningText = If you give any false information you may face financial penalties and prosecution. -verify.verificationDeclaration.confirm = Confirm - -verify.noSubcontractorsAdded.title = No subcontractors added -verify.noSubcontractorsAdded.heading = Verify your subcontractors -verify.noSubcontractorsAdded.p1 = You do not have any subcontractors at the moment. -verify.noSubcontractorsAdded.p2 = You will need to -verify.noSubcontractorsAdded.p2.link = add some subcontractors first -verify.noSubcontractorsAdded.p2.end = before you can create a verification request or monthly return. -verify.noSubcontractorsAdded.p3 = Back to -verify.noSubcontractorsAdded.p3.link = Manage your subcontractors - -verify.contractorEmailConfirmationStored.title = Do you want an email confirmation of this verification request? -verify.contractorEmailConfirmationStored.heading = Do you want an email confirmation of this verification request? -verify.contractorEmailConfirmationStored.paragraph = Your email address is currently {0}. You can get a confirmation sent to this address or use a different one. -verify.contractorEmailConfirmationStored.currentEmail = Send confirmation to current email address -verify.contractorEmailConfirmationStored.differentEmail = Use a different email address -verify.contractorEmailConfirmationStored.or = or -verify.contractorEmailConfirmationStored.doNotSend = Do not send an email confirmation -verify.contractorEmailConfirmationStored.checkYourAnswersLabel = Do you want confirmation by email? -verify.contractorEmailConfirmationStored.error.required = Select whether you want an email confirmation of this verification request -verify.contractorEmailConfirmationStored.change.hidden = do you want confirmation by email? - -verify.verifyYourSubcontractorsYesNo.title = No new subcontractors to verify -verify.verifyYourSubcontractorsYesNo.heading = Verify your subcontractors -verify.verifyYourSubcontractorsYesNo.p1 = There are no unverified subcontractors that you need to verify at the moment. -verify.verifyYourSubcontractorsYesNo.p2 = However, you can reverify any of your existing subcontractors to make sure that their tax treatment is correct and up to date. -verify.verifyYourSubcontractorsYesNo.p3 = You may want to reverify subcontractors if they: -verify.verifyYourSubcontractorsYesNo.list.l1 = have recently changed any of their information -verify.verifyYourSubcontractorsYesNo.list.l2 = have not been included on a return recently and have lost their verified status -verify.verifyYourSubcontractorsYesNo.list.l3 = are about to lose their verified status -verify.verifyYourSubcontractorsYesNo.heading2 = Do you want to add existing subcontractors to this verification request? -verify.verifyYourSubcontractorsYesNo.error.required = Select yes if you want to add existing subcontractors to this verification request - -verify.verificationRequestInProgress.title = Verification request in progress -verify.verificationRequestInProgress.heading = Verification request in progress -verify.verificationRequestInProgress.p1 = HMRC has not responded to your previous verification request yet. -verify.verificationRequestInProgress.p2 = You must wait for this response before you can verify any more subcontractors. -verify.verificationRequestInProgress.p3.link = Contact HMRC -verify.verificationRequestInProgress.p3 = if you have any questions about this verification request. -verify.verificationRequestInProgress.p4 = Back to -verify.verificationRequestInProgress.p4.link = Manage your subcontractors - -verify.selectSubcontractorsToReverify.title = Which subcontractors do you want to reverify? -verify.selectSubcontractorsToReverify.heading = Which subcontractors do you want to reverify? -verify.selectSubcontractorsToReverify.hint = Select the existing subcontractors you want to include in this verification request -verify.selectSubcontractorsToReverify.checkYourAnswersLabel = Which subcontractors do you want to reverify? -verify.selectSubcontractorsToReverify.error.required = Select at least one subcontractor to verify -verify.selectSubcontractorsToReverify.change.hidden = select subcontractors to reverify -verify.selectSubcontractorsToReverify.showingResults = Showing {0} to {1} of {2} results - - -verify.selectSubcontractorsToReverify.include = Include -verify.selectSubcontractorsToReverify.name = Name -verify.selectSubcontractorsToReverify.utr = UTR -verify.selectSubcontractorsToReverify.verified = Verified -verify.selectSubcontractorsToReverify.verificationNumber = Verification number -verify.selectSubcontractorsToReverify.taxTreatment = Tax treatment -verify.selectSubcontractorsToReverify.dateAdded = Date added - -site.pagination.previous = Previous -site.pagination.next = Next -site.pagination.landmark = Pagination - -verify.selectSubcontractor.title = Which subcontractors do you want to verify? -verify.selectSubcontractor.heading = Which subcontractors do you want to verify? -verify.selectSubcontractor.hint = Select the unverified subcontractors you want to add to this verification request -verify.selectSubcontractor.checkYourAnswersLabel = Subcontractors to verify -verify.selectSubcontractor.showingResults = Showing {0} to {1} of {2} results -verify.selectSubcontractor.error.required = Select at least one subcontractor to verify -verify.selectSubcontractor.change.hidden = subcontractors to verify - -verify.emailAddress.title = What email address should HMRC send this confirmation to? -verify.emailAddress.heading = What email address should HMRC send this confirmation to? -verify.emailAddress.hint = HMRC will only use this email address to confirm this verification request. Your saved email address will not be changed. -verify.emailAddress.hint.notStored = HMRC will only use this email address to confirm this verification request -verify.emailAddress.checkYourAnswersLabel = Email Address -verify.emailAddress.error.required = Enter an email address in the correct format, like name@example.com -verify.emailAddress.error.length = Enter a valid email address in the correct format, like name@example.com, up to 254 characters -verify.emailAddress.error.invalid = Enter a valid email address in the correct format, like name@example.com -verify.emailAddress.change.hidden = email address - -verify.reverifyExistingSubcontractorsYesNo.title = Reverify existing subcontractors -verify.reverifyExistingSubcontractorsYesNo.heading = Reverify existing subcontractors -verify.reverifyExistingSubcontractorsYesNo.p1 = To make sure that their tax treatment is correct and up to date, you can reverify any of your existing subcontractors. -verify.reverifyExistingSubcontractorsYesNo.p2 = You may want to reverify subcontractors if they: -verify.reverifyExistingSubcontractorsYesNo.list.l1 = have recently changed any of their information -verify.reverifyExistingSubcontractorsYesNo.list.l2 = have not been included on a return recently and have lost their verified status -verify.reverifyExistingSubcontractorsYesNo.list.l3 = are about to lose their verified status -verify.reverifyExistingSubcontractorsYesNo.subHeading = Do you want to add other subcontractors to this verification request? -verify.reverifyExistingSubcontractorsYesNo.error.required = Select yes if you want to add existing subcontractors to this verification request -verify.reverifyExistingSubcontractorsYesNo.checkYourAnswersLabel = Do you want to add other subcontractors to this verification request? -verify.reverifyExistingSubcontractorsYesNo.change.hidden = do you want to add other subcontractors to this verification request? - -verify.verifyDepartmentalError.title = There was a problem with your verification request -verify.verifyDepartmentalError.heading = There was a problem with your verification request -verify.verifyDepartmentalError.p1 = The subcontractors that you selected have not been verified and your request has not been saved. -verify.verifyDepartmentalError.contactHMRC.p1 = for more help. -verify.verifyDepartmentalError.contactHMRC.p1.link = Contact HMRC by phone -verify.verifyDepartmentalError.manageSubcontractors.p1 = Back to -verify.verifyDepartmentalError.manageSubcontractors.p1.link = Manage your subcontractors +verify.submissionSending.title = Submitting your verification request +verify.submissionSending.heading = Your verification request is being sent to HMRC +verify.submissionSending.paragraph = Do not refresh this page or press the back button while your submission is being processed. + +verify.contractorEmailConfirmationNotStored.title = Do you want an email confirmation of this verification request? +verify.contractorEmailConfirmationNotStored.heading = Do you want an email confirmation of this verification request? +verify.contractorEmailConfirmationNotStored.checkYourAnswersLabel = Do you want confirmation by email? +verify.contractorEmailConfirmationNotStored.error.required = Select yes if you want an email confirmation of this verification request +verify.contractorEmailConfirmationNotStored.change.hidden = do you want confirmation by email? + +verify.verificationDeclaration.title = Verification declaration +verify.verificationDeclaration.heading = Declaration +verify.verificationDeclaration.p1 = By submitting this verification request, you confirm that: +verify.verificationDeclaration.list.l1 = a formal arrangement is in place (for example, tender accepted, contract agreed, order placed) for all of the subcontractors to be verified in this request. +verify.verificationDeclaration.list.l2 = the information given in this verification request is correct and complete to the best of your knowledge and belief. +verify.verificationDeclaration.warningText = If you give any false information you may face financial penalties and prosecution. +verify.verificationDeclaration.confirm = Confirm + +verify.noSubcontractorsAdded.title = No subcontractors added +verify.noSubcontractorsAdded.heading = Verify your subcontractors +verify.noSubcontractorsAdded.p1 = You do not have any subcontractors at the moment. +verify.noSubcontractorsAdded.p2 = You will need to +verify.noSubcontractorsAdded.p2.link = add some subcontractors first +verify.noSubcontractorsAdded.p2.end = before you can create a verification request or monthly return. +verify.noSubcontractorsAdded.p3 = Back to +verify.noSubcontractorsAdded.p3.link = Manage your subcontractors + +verify.contractorEmailConfirmationStored.title = Do you want an email confirmation of this verification request? +verify.contractorEmailConfirmationStored.heading = Do you want an email confirmation of this verification request? +verify.contractorEmailConfirmationStored.paragraph = Your email address is currently {0}. You can get a confirmation sent to this address or use a different one. +verify.contractorEmailConfirmationStored.currentEmail = Send confirmation to current email address +verify.contractorEmailConfirmationStored.differentEmail = Use a different email address +verify.contractorEmailConfirmationStored.or = or +verify.contractorEmailConfirmationStored.doNotSend = Do not send an email confirmation +verify.contractorEmailConfirmationStored.checkYourAnswersLabel = Do you want confirmation by email? +verify.contractorEmailConfirmationStored.error.required = Select whether you want an email confirmation of this verification request +verify.contractorEmailConfirmationStored.change.hidden = do you want confirmation by email? + +verify.verifyYourSubcontractorsYesNo.title = No new subcontractors to verify +verify.verifyYourSubcontractorsYesNo.heading = Verify your subcontractors +verify.verifyYourSubcontractorsYesNo.p1 = There are no unverified subcontractors that you need to verify at the moment. +verify.verifyYourSubcontractorsYesNo.p2 = However, you can reverify any of your existing subcontractors to make sure that their tax treatment is correct and up to date. +verify.verifyYourSubcontractorsYesNo.p3 = You may want to reverify subcontractors if they: +verify.verifyYourSubcontractorsYesNo.list.l1 = have recently changed any of their information +verify.verifyYourSubcontractorsYesNo.list.l2 = have not been included on a return recently and have lost their verified status +verify.verifyYourSubcontractorsYesNo.list.l3 = are about to lose their verified status +verify.verifyYourSubcontractorsYesNo.heading2 = Do you want to add existing subcontractors to this verification request? +verify.verifyYourSubcontractorsYesNo.error.required = Select yes if you want to add existing subcontractors to this verification request + +verify.verificationRequestInProgress.title = Verification request in progress +verify.verificationRequestInProgress.heading = Verification request in progress +verify.verificationRequestInProgress.p1 = HMRC has not responded to your previous verification request yet. +verify.verificationRequestInProgress.p2 = You must wait for this response before you can verify any more subcontractors. +verify.verificationRequestInProgress.p3.link = Contact HMRC +verify.verificationRequestInProgress.p3 = if you have any questions about this verification request. +verify.verificationRequestInProgress.p4 = Back to +verify.verificationRequestInProgress.p4.link = Manage your subcontractors + +verify.selectSubcontractorsToReverify.title = Which subcontractors do you want to reverify? +verify.selectSubcontractorsToReverify.heading = Which subcontractors do you want to reverify? +verify.selectSubcontractorsToReverify.hint = Select the existing subcontractors you want to include in this verification request +verify.selectSubcontractorsToReverify.checkYourAnswersLabel = Which subcontractors do you want to reverify? +verify.selectSubcontractorsToReverify.error.required = Select at least one subcontractor to verify +verify.selectSubcontractorsToReverify.change.hidden = select subcontractors to reverify +verify.selectSubcontractorsToReverify.showingResults = Showing {0} to {1} of {2} results +verify.selectSubcontractorsToReverify.include = Include +verify.selectSubcontractorsToReverify.name = Name +verify.selectSubcontractorsToReverify.utr = UTR +verify.selectSubcontractorsToReverify.verified = Verified +verify.selectSubcontractorsToReverify.verificationNumber = Verification number +verify.selectSubcontractorsToReverify.taxTreatment = Tax treatment +verify.selectSubcontractorsToReverify.dateAdded = Date added + +verify.selectSubcontractor.title = Which subcontractors do you want to verify? +verify.selectSubcontractor.heading = Which subcontractors do you want to verify? +verify.selectSubcontractor.hint = Select the unverified subcontractors you want to add to this verification request +verify.selectSubcontractor.checkYourAnswersLabel = Subcontractors to verify +verify.selectSubcontractor.showingResults = Showing {0} to {1} of {2} results +verify.selectSubcontractor.error.required = Select at least one subcontractor to verify +verify.selectSubcontractor.change.hidden = subcontractors to verify + +verify.emailAddress.title = What email address should HMRC send this confirmation to? +verify.emailAddress.heading = What email address should HMRC send this confirmation to? +verify.emailAddress.hint = HMRC will only use this email address to confirm this verification request. Your saved email address will not be changed. +verify.emailAddress.hint.notStored = HMRC will only use this email address to confirm this verification request +verify.emailAddress.checkYourAnswersLabel = Email Address +verify.emailAddress.error.required = Enter an email address in the correct format, like name@example.com +verify.emailAddress.error.length = Enter a valid email address in the correct format, like name@example.com, up to 254 characters +verify.emailAddress.error.invalid = Enter a valid email address in the correct format, like name@example.com +verify.emailAddress.change.hidden = email address + +verify.reverifyExistingSubcontractorsYesNo.title = Reverify existing subcontractors +verify.reverifyExistingSubcontractorsYesNo.heading = Reverify existing subcontractors +verify.reverifyExistingSubcontractorsYesNo.p1 = To make sure that their tax treatment is correct and up to date, you can reverify any of your existing subcontractors. +verify.reverifyExistingSubcontractorsYesNo.p2 = You may want to reverify subcontractors if they: +verify.reverifyExistingSubcontractorsYesNo.list.l1 = have recently changed any of their information +verify.reverifyExistingSubcontractorsYesNo.list.l2 = have not been included on a return recently and have lost their verified status +verify.reverifyExistingSubcontractorsYesNo.list.l3 = are about to lose their verified status +verify.reverifyExistingSubcontractorsYesNo.subHeading = Do you want to add other subcontractors to this verification request? +verify.reverifyExistingSubcontractorsYesNo.error.required = Select yes if you want to add existing subcontractors to this verification request +verify.reverifyExistingSubcontractorsYesNo.checkYourAnswersLabel = Do you want to add other subcontractors to this verification request? +verify.reverifyExistingSubcontractorsYesNo.change.hidden = do you want to add other subcontractors to this verification request? + +verify.verifyDepartmentalError.title = There was a problem with your verification request +verify.verifyDepartmentalError.heading = There was a problem with your verification request +verify.verifyDepartmentalError.p1 = The subcontractors that you selected have not been verified and your request has not been saved. +verify.verifyDepartmentalError.contactHMRC.p1 = for more help. +verify.verifyDepartmentalError.contactHMRC.p1.link = Contact HMRC by phone +verify.verifyDepartmentalError.manageSubcontractors.p1 = Back to +verify.verifyDepartmentalError.manageSubcontractors.p1.link = Manage your subcontractors + +verify.verificationRequestSubmitted.title = Verification request submitted +verify.verificationRequestSubmitted.heading = Verification request submitted +verify.verificationRequestSubmitted.reference = Your verification reference number +verify.verificationRequestSubmitted.submittedAt = Submitted at {0} +verify.verificationRequestSubmitted.details.subHeading = Verification request details +verify.verificationRequestSubmitted.subcontractorsToVerify.label = Subcontractors to verify +verify.verificationRequestSubmitted.subcontractorsToReverify.label = Subcontractors to reverify +verify.verificationRequestSubmitted.email.confirmation = Confirmation of submission has been sent to {0}. +verify.verificationRequestSubmitted.email.verification = You can access this request in read-only format from your +verify.verificationRequestSubmitted.email.verification.link = verification history +verify.verificationRequestSubmitted.print.text = You can also save this page or print a copy for your records. +verify.verificationRequestSubmitted.print.link = Print this page +verify.verificationRequestSubmitted.needHelp.subHeading = Need help? +verify.verificationRequestSubmitted.needHelp.contactHMRC.link = contact HMRC +verify.verificationRequestSubmitted.needHelp.p1 = For any questions about your verification request, +verify.verificationRequestSubmitted.needHelp.p2 = You will need the reference number of this verification request. +verify.verificationRequestSubmitted.needHelp.p3 = Back to +verify.verificationRequestSubmitted.needHelp.manageSubcontractors.link = Manage your subcontractors +verify.verificationRequestSubmitted.feedback.subHeading = Before you go +verify.verificationRequestSubmitted.feedback.p1 = Your feedback helps us make our service better. +verify.verificationRequestSubmitted.feedback.p2 = to share your feedback on this service. +verify.verificationRequestSubmitted.feedback.survey.link = Take a short survey diff --git a/test/controllers/verify/VerificationRequestSubmittedControllerSpec.scala b/test/controllers/verify/VerificationRequestSubmittedControllerSpec.scala new file mode 100644 index 00000000..6740bdd9 --- /dev/null +++ b/test/controllers/verify/VerificationRequestSubmittedControllerSpec.scala @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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.verify + +import base.SpecBase +import play.api.test.FakeRequest +import play.api.test.Helpers.* + +class VerificationRequestSubmittedControllerSpec extends SpecBase { + + "VerificationRequestSubmitted Controller" - { + + "must return OK for a GET" in { + + val application = + applicationBuilder(userAnswers = Some(emptyUserAnswers)).build() + + running(application) { + + val request = + FakeRequest( + GET, + routes.VerificationRequestSubmittedController.onPageLoad().url + ) + + val result = + route(application, request).value + + status(result) mustEqual OK + } + } + } +} diff --git a/test/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModelSpec.scala b/test/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModelSpec.scala new file mode 100644 index 00000000..339d4353 --- /dev/null +++ b/test/viewmodels/checkAnswers/verify/VerificationRequestSubmittedViewModelSpec.scala @@ -0,0 +1,173 @@ +/* + * Copyright 2026 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 viewmodels.checkAnswers.verify + +import models.UserAnswers +import models.SubcontractorViewModel +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.TryValues.convertTryToSuccessOrFailure +import pages.verify.{EmailAddressPage, SelectSubcontractorPage} + +import java.time.LocalDateTime + +class VerificationRequestSubmittedViewModelSpec extends AnyFreeSpec with Matchers { + + private val now = LocalDateTime.of(2026, 4, 27, 10, 30) + + "VerificationRequestSubmittedViewModel" - { + + "showEmail" - { + + "must return true when confirmationEmail is defined" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq("Sub A"), + confirmationEmail = Some("test@test.com") + ) + + vm.showEmail shouldBe true + } + + "must return false when confirmationEmail is not defined" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq("Sub A"), + confirmationEmail = None + ) + + vm.showEmail shouldBe false + } + } + + "showVerify" - { + + "must return true when subcontractorsToVerify is non-empty" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq("Sub A") + ) + + vm.showVerify shouldBe true + } + + "must return false when subcontractorsToVerify is empty" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq.empty + ) + + vm.showVerify shouldBe false + } + } + + "showReverify" - { + + "must return true when subcontractorsToReverify is non-empty" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq("Sub A"), + subcontractorsToReverify = Seq("Sub B") + ) + + vm.showReverify shouldBe true + } + + "must return false when subcontractorsToReverify is empty" in { + + val vm = + VerificationRequestSubmittedViewModel( + referenceNumber = "REF123", + submittedAt = now, + subcontractorsToVerify = Seq("Sub A"), + subcontractorsToReverify = Seq.empty + ) + + vm.showReverify shouldBe false + } + } + } + + "VerificationRequestSubmittedViewModel.fromUserAnswers" - { + + "must map subcontractorsToVerify from SelectSubcontractorPage" in { + + val subcontractors = + Set( + SubcontractorViewModel(id = "ID1", name = "Brody, Martin"), + SubcontractorViewModel(id = "ID2", name = "Hooper And Associates") + ) + + val userAnswers = + UserAnswers("id") + .set(SelectSubcontractorPage, subcontractors) + .success + .value + + val vm = + VerificationRequestSubmittedViewModel.fromUserAnswers(userAnswers) + + vm.subcontractorsToVerify shouldBe + Seq("Brody, Martin", "Hooper And Associates") + + vm.showVerify shouldBe true + } + + "must map confirmationEmail from EmailAddressPage when present" in { + + val userAnswers = + UserAnswers("id") + .set(EmailAddressPage, "test@testmail.com") + .success + .value + + val vm = + VerificationRequestSubmittedViewModel.fromUserAnswers(userAnswers) + + vm.confirmationEmail shouldBe Some("test@testmail.com") + vm.showEmail shouldBe true + } + + "must return empty values when pages are absent" in { + + val vm = + VerificationRequestSubmittedViewModel.fromUserAnswers( + UserAnswers("id") + ) + + vm.subcontractorsToVerify shouldBe Seq.empty + vm.confirmationEmail shouldBe None + vm.showVerify shouldBe false + vm.showEmail shouldBe false + } + } +} diff --git a/test/views/components/PrintLinkSpec.scala b/test/views/components/PrintLinkSpec.scala new file mode 100644 index 00000000..c3531121 --- /dev/null +++ b/test/views/components/PrintLinkSpec.scala @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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 views.components + +import base.SpecBase +import org.jsoup.Jsoup +import org.jsoup.nodes.Document +import org.jsoup.select.Elements +import play.api.i18n.{Lang, Messages, MessagesApi, MessagesImpl} +import play.api.mvc.RequestHeader +import play.api.test.FakeRequest +import play.twirl.api.HtmlFormat +import views.html.components.PrintLink + +class PrintLinkSpec extends SpecBase { + + "PrintLink" - { + + "must render a govuk link inside a govuk-body paragraph with default id" in new Setup { + val html: HtmlFormat.Appendable = printLink("monthlyreturns.submissionSuccessful.print") + + paragraph(html).size mustBe 1 + + val link: Elements = linkById(html, defaultId) + link.size mustBe 1 + link.attr("href") mustBe "#" + link.attr("data-module") mustBe "hmrc-print-link" + link.text() mustBe messages("monthlyreturns.submissionSuccessful.print") + + link.hasClass("govuk-link") mustBe true + link.hasClass("hmrc-!-js-visible") mustBe true + link.hasClass("govuk-!-display-none-print") mustBe true + } + + "must apply the provided id" in new Setup { + val html: HtmlFormat.Appendable = + printLink("monthlyreturns.submissionSuccessful.print", id = "print-bottom") + + val link: Elements = linkById(html, "print-bottom") + link.size mustBe 1 + } + + "must apply extra classes when provided" in new Setup { + val html: HtmlFormat.Appendable = + printLink( + "monthlyreturns.submissionSuccessful.print", + id = "print-extra", + extraClasses = "custom-class" + ) + + val link: Elements = linkById(html, "print-extra") + link.hasClass("custom-class") mustBe true + } + } + + trait Setup { + private val app = applicationBuilder().build() + val printLink: PrintLink = app.injector.instanceOf[PrintLink] + val defaultId = "print-link" + + implicit val request: RequestHeader = FakeRequest() + implicit val messages: Messages = + MessagesImpl(Lang.defaultLang, app.injector.instanceOf[MessagesApi]) + + def docOf(html: HtmlFormat.Appendable): Document = + Jsoup.parse(html.body) + + def select(html: HtmlFormat.Appendable, cssSelector: String): Elements = + docOf(html).select(cssSelector) + + def paragraph(html: HtmlFormat.Appendable): Elements = + select(html, "p.govuk-body") + + def linkById(html: HtmlFormat.Appendable, id: String): Elements = + select(html, s"a.govuk-link#$id") + } +} diff --git a/test/views/verify/VerificationRequestSubmittedViewSpec.scala b/test/views/verify/VerificationRequestSubmittedViewSpec.scala new file mode 100644 index 00000000..299ba9db --- /dev/null +++ b/test/views/verify/VerificationRequestSubmittedViewSpec.scala @@ -0,0 +1,179 @@ +/* + * Copyright 2026 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 views.verify + +import config.FrontendAppConfig +import org.jsoup.Jsoup +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec +import org.scalatestplus.play.guice.GuiceOneAppPerSuite +import play.api.i18n.{Lang, Messages, MessagesApi, MessagesImpl} +import play.api.mvc.Request +import play.api.test.FakeRequest +import viewmodels.checkAnswers.verify.VerificationRequestSubmittedViewModel +import views.html.verify.VerificationRequestSubmittedView + +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class VerificationRequestSubmittedViewSpec extends AnyWordSpec with Matchers with GuiceOneAppPerSuite { + + "VerificationRequestSubmittedView" should { + + "render the page correctly when reverify list and email are present" in new Setup { + + val doc = Jsoup.parse(html.toString()) + + doc.title must include( + messages("verify.verificationRequestSubmitted.title") + ) + + doc.select(".govuk-panel__title").text mustBe + messages("verify.verificationRequestSubmitted.heading") + + doc.select(".govuk-panel__body").text must include(referenceNumber) + + doc.text must include( + messages( + "verify.verificationRequestSubmitted.submittedAt", + submittedAt.format( + DateTimeFormatter.ofPattern("HH:mm 'on' dd MMMM yyyy") + ) + ) + ) + + doc.select("h2").text must include( + messages("verify.verificationRequestSubmitted.details.subHeading") + ) + + subcontractorsToVerify.foreach { name => + doc.select("ul.govuk-list--bullet").text must include(name) + } + + subcontractorsToReverify.foreach { name => + doc.select("ul.govuk-list--bullet").text must include(name) + } + + doc.select("p.govuk-body").text must include(email) + + val emailVerificationLink = + doc.select(s"a[href='#']") + + emailVerificationLink.text must include( + messages("verify.verificationRequestSubmitted.email.verification.link") + ) + + doc.select(".govuk-inset-text").text must include( + messages("verify.verificationRequestSubmitted.print.text") + ) + + doc.select(".govuk-inset-text").text must include( + messages("verify.verificationRequestSubmitted.print.link") + ) + + doc.select("h2").text must include( + messages("verify.verificationRequestSubmitted.needHelp.subHeading") + ) + + val manageLink = + doc.select(s"a[href='${appConfig.manageSubcontractorsUrl}']") + + manageLink.text must include( + messages("verify.verificationRequestSubmitted.needHelp.manageSubcontractors.link") + ) + + doc.select("h2").text must include( + messages("verify.verificationRequestSubmitted.feedback.subHeading") + ) + + val surveyLink = + doc.select(s"a[href='${appConfig.exitSurveyUrl}']") + + surveyLink.size mustBe 1 + surveyLink.attr("target") mustBe "" + + surveyLink.first.parent.text must include( + messages("verify.verificationRequestSubmitted.feedback.p2") + ) + } + + "not render reverify section or email paragraph when both are absent" in new Setup { + + override val viewModel: VerificationRequestSubmittedViewModel = + viewModel.copy( + subcontractorsToReverify = Seq.empty, + confirmationEmail = None + ) + + val doc = Jsoup.parse(html.toString()) + + doc.text must not include + messages("verify.verificationRequestSubmitted.subcontractorsToReverify.label") + + doc.text must not include email + } + } + + trait Setup { + + implicit val request: Request[_] = + FakeRequest() + + implicit val messages: Messages = + MessagesImpl( + Lang.defaultLang, + app.injector.instanceOf[MessagesApi] + ) + + implicit val appConfig: FrontendAppConfig = + app.injector.instanceOf[FrontendAppConfig] + + val view: VerificationRequestSubmittedView = + app.injector.instanceOf[VerificationRequestSubmittedView] + + val referenceNumber = "Reference number 12345" + val submittedAt = LocalDateTime.of(2026, 4, 27, 10, 30) + + val subcontractorsToVerify = + Seq( + "Brody, Martin", + "Hooper And Associates", + "Quint Transportation", + "The Kintner Group" + ) + + val subcontractorsToReverify = + Seq( + "Grant, Alan", + "InGen Research" + ) + + val email = "test@testmail.com" + + val viewModel: VerificationRequestSubmittedViewModel = + VerificationRequestSubmittedViewModel( + referenceNumber = referenceNumber, + submittedAt = submittedAt, + subcontractorsToVerify = subcontractorsToVerify, + subcontractorsToReverify = subcontractorsToReverify, + confirmationEmail = Some(email) + ) + + lazy val html = + view(viewModel) + } +}