Skip to content

Commit

Permalink
Pods 10219 (#711)
Browse files Browse the repository at this point in the history
* PODS-10219 - package

* PODS-10219 - PenaltyTypeView

* PODS-10219 - PSA Select Quarters View

* PODS-10219 - select scheme view

* PODS-10219 - update scheme overview, selectyear and quarter, paymentorchargetype views

* PODS-10219 - implement merges

* PODS-10219 - clean up compiler errors and warnings

* Minor twirl changes and create interestdetailsview & new

* PODS-10219 - year and quarter controller tests refactored

* PODS-10219 - refactor twirl templates for refunds & controllers. Tests currently failing

* PODS-10219 - refactor tests and add paymentsAndCharges views

* PODS-10219 - make twirl compile

* PODS-10219: twirl migration for PsaPaymentsAndCharges

* PODS-10219 - update messages and formatting of twirl template

* PODS-10219 - build out twirl templates to make controller changes

* PODS-10219 - minor change

* PODS-10219 - edit controller for penalties and charges

* PODS-10219 - undo change

* PODS-10219 - refactor of twirl templates to remove redundant parameters

* PODS-10219 - add notes

* psa payments and charges

* PODS-10219 push latest changes

* Interest all charge details page

* PODS-10219 - final changes to PSA twirl folder

* PODS-10219 - update scheme payments and charge details twirl template & logic

* PODS-10219 - update final controllers to render twirl views

* PODS-10219 - update twirl files

* PODS-10219 minor test changes

* PODS-10219 - update twirl templates to render charge details

* PODS-10219 - remove nunjucks elements from tests.

* PODS-10219 - minor update to twirl template to place paragraph properly.:

* PODS-10219 - update test cases in PSA folder to pass

* Fix tests

* PODS-10219 - final test files amended to pass

* PODS-10219 - code cleanup

* PODS-10219 - updated test cases in psa/scheme folders

* PODS-10219 - test passing in interest controller spec

* fix for PaymentsAndChargeDetailsControllerSpec

* PODS-10219 - PsaPenaltiesAndChargeDetailsControllerSpec update

* PODS-10219 - remove trailing comma for build

* PODS-10219 - remove commas

* PODS-10219 - comma

* PODS-10219 - minor tweak to twirl header styling

* PODS-10219 - header switch

* PODS-10219 - twirl edits

* PODS-10219 - twirl

* PODS-10219 - twirl

* PODS-10219 - change message link

* PODS-10219 - change message

* PODS-10219 - messages

* PODS-10219 - spacing on interest psa pages

* PODS-10219 - messaging

* PODS-10219 - spacing on page

* PODS-10219 - Alignment of table

* PODS-10219 - scheme overview

* PODS-10219 - financial overviews old

* PODS-10219 - payments and charges view

* PODS-10219 - add table to charge details view

* PODS-10219 - conf

* PODS-10219 - twirl

* financials

* PODS-10219 - title change

* PODS-10219 - inset text

* PODS-10219 - test passing

* PODS-10219 titles

* PODS-10219 - changes

* PODS-10219 - titling

* PODS-10219 - add test to bring up coverage

* PODS-10219 - switch back financials toggle

* PODS-10219 - new test for coverage

* PODS-10219 - amend overview titles

* PODS-10219 - align with main

* PODS-10219 - Amendment to scheme twirls

* PODS-10219 - formatting

* PODS-10219 - title issues

* PODS-10219 title error

* PODS-10219 - case change

* PODS-10219 - minor tweak

* PODS-10219 - test coverage

* PODS-10219 - removed commented code

* PODS-10219 - Alter return links on Payments And Charges pages

* PODS-10219: Added test template

* PODS-10219 - Update tests and clean up code

* PODS-10219 - test in progress

* PODS-10219 - Update tests and code cleanup

* PODS-10219 - Remove trailing comma

* Added new test case for PaymentsAndChargeDetailsController

---------

Co-authored-by: Veera Kota <veeraskota@gmail.com>
Co-authored-by: LauraToddCodes <74312582+LauraToddCodes@users.noreply.github.com>
Co-authored-by: Pavel Vjalicin <pavelvjalicin@users.noreply.github.com>
  • Loading branch information
4 people authored Jan 24, 2025
1 parent 23f14fb commit 948e03f
Show file tree
Hide file tree
Showing 145 changed files with 4,366 additions and 4,254 deletions.
2 changes: 1 addition & 1 deletion app/connectors/AFTConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import play.api.http.Status._
import play.api.libs.json._
import uk.gov.hmrc.http.HttpReads.Implicits._
import uk.gov.hmrc.http.client.HttpClientV2
import uk.gov.hmrc.http.{HeaderCarrier, HttpClient, HttpResponse, StringContextOps}
import uk.gov.hmrc.http.{HeaderCarrier, HttpResponse, StringContextOps}
import utils.{DateHelper, HttpResponseHelper}

import java.time.LocalDate
Expand Down
5 changes: 1 addition & 4 deletions app/connectors/FinancialStatementConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@ package connectors
import com.google.inject.Inject
import config.FrontendAppConfig
import models.financialStatement._
import play.api.Logger
import play.api.http.Status._
import uk.gov.hmrc.http.HttpReads.Implicits._
import uk.gov.hmrc.http.client.HttpClientV2
import uk.gov.hmrc.http.{HeaderCarrier, HttpClient, HttpResponse, StringContextOps}
import uk.gov.hmrc.http.{HeaderCarrier, HttpResponse, StringContextOps}
import utils.HttpResponseHelper

import scala.concurrent.{ExecutionContext, Future}

class FinancialStatementConnector @Inject()(httpClientV2: HttpClientV2, config: FrontendAppConfig)
extends HttpResponseHelper {

private val logger = Logger(classOf[FinancialStatementConnector])

def getPsaFS(psaId: String)
(implicit hc: HeaderCarrier, ec: ExecutionContext): Future[PsaFS] = {

Expand Down
2 changes: 1 addition & 1 deletion app/connectors/ListOfSchemesConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import play.api.http.Status._
import play.api.libs.json.{JsError, JsResultException, JsSuccess, Json}
import uk.gov.hmrc.http.HttpReads.Implicits._
import uk.gov.hmrc.http.client.HttpClientV2
import uk.gov.hmrc.http.{HeaderCarrier, HttpClient, HttpResponse, StringContextOps}
import uk.gov.hmrc.http.{HeaderCarrier, HttpResponse, StringContextOps}

import scala.concurrent.{ExecutionContext, Future}

Expand Down
2 changes: 1 addition & 1 deletion app/connectors/MinimalConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import play.api.http.Status._
import play.api.libs.json._
import uk.gov.hmrc.http.HttpReads.Implicits._
import uk.gov.hmrc.http.client.HttpClientV2
import uk.gov.hmrc.http.{HttpClient, _}
import uk.gov.hmrc.http._
import utils.HttpResponseHelper

import scala.concurrent.{ExecutionContext, Future}
Expand Down
2 changes: 1 addition & 1 deletion app/connectors/SchemeDetailsConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import play.api.http.Status._
import play.api.libs.json.{JsError, JsResultException, JsSuccess, Json}
import uk.gov.hmrc.http.HttpReads.Implicits._
import uk.gov.hmrc.http.client.HttpClientV2
import uk.gov.hmrc.http.{HttpClient, _}
import uk.gov.hmrc.http._
import utils.HttpResponseHelper

import scala.concurrent.{ExecutionContext, Future}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/AFTOverviewController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AFTOverviewController @Inject()(
quartersInProgress <- quartersService.getInProgressQuarters(srn = srn, pstr = schemeDetails.pstr)
allPastYears <- quartersService.getPastYears(pstr = schemeDetails.pstr)
pastYearsAndQuarters <- Future.traverse(displayYears(allPastYears))(
year => quartersService.getPastQuarters(pstr = schemeDetails.pstr, year = year).flatMap(quarters => Future.successful(year, quarters))
year => quartersService.getPastQuarters(pstr = schemeDetails.pstr, year = year).flatMap(quarters => Future.successful((year, quarters)))
)
}
yield OverviewInfo(schemeDetails, quartersInProgress, pastYearsAndQuarters, outstandingAmount)
Expand Down
10 changes: 1 addition & 9 deletions app/controllers/ChargeTypeController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import connectors.cache.UserAnswersCacheConnector
import controllers.actions._
import forms.ChargeTypeFormProvider
import models.LocalDateBinder._
import models.{AccessType, ChargeType, GenericViewModel, NormalMode}
import models.{AccessType, ChargeType, NormalMode}
import navigators.CompoundNavigator
import pages._
import play.api.i18n.{I18nSupport, MessagesApi}
Expand Down Expand Up @@ -97,12 +97,4 @@ class ChargeTypeController @Inject()(
)
}
}

private def viewModel(schemeName: String, srn: String, startDate: LocalDate, accessType: AccessType, version: Int): GenericViewModel = {
GenericViewModel(
submitUrl = routes.ChargeTypeController.onSubmit(srn, startDate, accessType, version).url,
returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url,
schemeName = schemeName
)
}
}
4 changes: 1 addition & 3 deletions app/controllers/NotSubmissionTimeController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ package controllers
import config.FrontendAppConfig
import controllers.actions.{AllowAccessActionProviderForIdentifierRequest, IdentifierAction}
import models.CommonQuarters
import play.api.i18n.{I18nSupport, Messages, MessagesApi}
import play.api.libs.json.Json
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.Results.Ok
import play.api.mvc.{Action, AnyContent}
import renderer.Renderer

import java.time.LocalDate
import java.time.format.DateTimeFormatter
Expand Down
11 changes: 1 addition & 10 deletions app/controllers/YearsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ package controllers
import config.FrontendAppConfig
import controllers.actions._
import forms.YearsFormProvider
import models.requests.IdentifierRequest
import models.{GenericViewModel, StartYears, Year}
import models.{StartYears, Year}
import play.api.data.Form
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
Expand Down Expand Up @@ -77,12 +76,4 @@ class YearsController @Inject()(
)
}

private def viewModel(schemeName: String, srn: String)(implicit request: IdentifierRequest[_]): GenericViewModel = {
GenericViewModel(
submitUrl = routes.YearsController.onSubmit(srn).url,
returnUrl = config.schemeDashboardUrl(request).format(srn),
schemeName = schemeName
)
}

}
11 changes: 1 addition & 10 deletions app/controllers/chargeA/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package controllers.chargeA

import config.FrontendAppConfig
import connectors.SchemeDetailsConnector
import connectors.cache.UserAnswersCacheConnector
import controllers.actions._
import models.LocalDateBinder._
import models.{AccessType, NormalMode}
Expand All @@ -27,13 +24,11 @@ import pages.SchemeNameQuery
import pages.chargeA.WhatYouWillNeedPage
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import renderer.Renderer
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.chargeA.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -42,13 +37,9 @@ class WhatYouWillNeedController @Inject()(
allowAccess: AllowAccessActionProvider,
requireData: DataRequiredAction,
val controllerComponents: MessagesControllerComponents,
config: FrontendAppConfig,
renderer: Renderer,
schemeDetailsConnector: SchemeDetailsConnector,
userAnswersCacheConnector: UserAnswersCacheConnector,
navigator: CompoundNavigator,
view: WhatYouWillNeedView
)(implicit ec: ExecutionContext)
)
extends FrontendBaseController
with I18nSupport {

Expand Down
9 changes: 1 addition & 8 deletions app/controllers/chargeB/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package controllers.chargeB

import connectors.SchemeDetailsConnector
import connectors.cache.UserAnswersCacheConnector
import controllers.actions._
import models.LocalDateBinder._
import models.{AccessType, NormalMode}
Expand All @@ -26,13 +24,11 @@ import pages.SchemeNameQuery
import pages.chargeB.WhatYouWillNeedPage
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import renderer.Renderer
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.chargeB.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -41,12 +37,9 @@ class WhatYouWillNeedController @Inject()(
allowAccess: AllowAccessActionProvider,
requireData: DataRequiredAction,
val controllerComponents: MessagesControllerComponents,
renderer: Renderer,
schemeDetailsConnector: SchemeDetailsConnector,
userAnswersCacheConnector: UserAnswersCacheConnector,
navigator: CompoundNavigator,
view: WhatYouWillNeedView
)(implicit ec: ExecutionContext)
)
extends FrontendBaseController
with I18nSupport {

Expand Down
11 changes: 2 additions & 9 deletions app/controllers/chargeC/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package controllers.chargeC

import config.FrontendAppConfig
import connectors.SchemeDetailsConnector
import connectors.cache.UserAnswersCacheConnector
import controllers.actions._
import models.LocalDateBinder._
import models.{AccessType, NormalMode}
Expand All @@ -32,7 +29,6 @@ import views.html.chargeC.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -42,11 +38,8 @@ class WhatYouWillNeedController @Inject()(
requireData: DataRequiredAction,
val controllerComponents: MessagesControllerComponents,
view : WhatYouWillNeedView,
schemeDetailsConnector: SchemeDetailsConnector,
userAnswersCacheConnector: UserAnswersCacheConnector,
navigator: CompoundNavigator,
config: FrontendAppConfig
)(implicit ec: ExecutionContext)
navigator: CompoundNavigator
)
extends FrontendBaseController
with I18nSupport {

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/chargeD/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import views.html.chargeD.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -41,7 +40,7 @@ class WhatYouWillNeedController @Inject()(
val controllerComponents: MessagesControllerComponents,
navigator: CompoundNavigator,
view: WhatYouWillNeedView
)(implicit ec: ExecutionContext) extends FrontendBaseController with I18nSupport {
) extends FrontendBaseController with I18nSupport {

def onPageLoad(srn: String, startDate: LocalDate, accessType: AccessType, version: Int, index: Int): Action[AnyContent] =
(identify andThen getData(srn, startDate) andThen requireData andThen allowAccess(srn, startDate, None, version, accessType)) {
Expand Down
14 changes: 1 addition & 13 deletions app/controllers/chargeE/ChargeDetailsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import controllers.actions._
import forms.chargeE.ChargeDetailsFormProvider
import models.LocalDateBinder._
import models.chargeE.ChargeEDetails
import models.{AccessType, ChargeType, CommonQuarters, GenericViewModel, Index, Mode}
import models.{AccessType, ChargeType, CommonQuarters, Index, Mode}
import navigators.CompoundNavigator
import pages.chargeE.{ChargeDetailsPage, MemberDetailsPage}
import play.api.data.Form
Expand Down Expand Up @@ -73,12 +73,6 @@ class ChargeDetailsController @Inject()(override val messagesApi: MessagesApi,
case None => form(mininimumChargeValue, startDate)
}

val viewModel = GenericViewModel(
submitUrl = routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version, index).url,
returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url,
schemeName = schemeName
)

val submitUrl = routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version, index)
val returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url

Expand All @@ -102,12 +96,6 @@ class ChargeDetailsController @Inject()(override val messagesApi: MessagesApi,
.bindFromRequest()
.fold(
formWithErrors => {
val viewModel = GenericViewModel(
submitUrl = routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version, index).url,
returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url,
schemeName = schemeName
)

val submitUrl = routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version, index)
val returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url

Expand Down
5 changes: 2 additions & 3 deletions app/controllers/chargeE/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controllers.chargeE
import controllers.actions._
import models.ChargeType.ChargeTypeAnnualAllowance
import models.LocalDateBinder._
import models.{AccessType, GenericViewModel, NormalMode}
import models.{AccessType, NormalMode}
import navigators.CompoundNavigator
import pages.chargeE.WhatYouWillNeedPage
import pages.{IsPublicServicePensionsRemedyPage, SchemeNameQuery}
Expand All @@ -30,7 +30,6 @@ import views.html.chargeE.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -41,7 +40,7 @@ class WhatYouWillNeedController @Inject()(
val controllerComponents: MessagesControllerComponents,
navigator: CompoundNavigator,
view: WhatYouWillNeedView
)(implicit ec: ExecutionContext) extends FrontendBaseController with I18nSupport {
) extends FrontendBaseController with I18nSupport {

def onPageLoad(srn: String, startDate: LocalDate, accessType: AccessType, version: Int, index: Int): Action[AnyContent] =
(identify andThen getData(srn, startDate) andThen requireData andThen allowAccess(srn, startDate, None, version, accessType)) { implicit request =>
Expand Down
10 changes: 1 addition & 9 deletions app/controllers/chargeF/ChargeDetailsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@

package controllers.chargeF

import config.FrontendAppConfig
import connectors.cache.UserAnswersCacheConnector
import controllers.DataRetrievals
import controllers.actions._
import forms.chargeF.ChargeDetailsFormProvider
import helpers.DeleteChargeHelper
import models.LocalDateBinder._
import models.chargeF.ChargeDetails
import models.{AccessType, ChargeType, GenericViewModel, Mode, Quarters}
import models.{AccessType, ChargeType, Mode, Quarters}
import navigators.CompoundNavigator
import pages.chargeF.ChargeDetailsPage
import play.api.data.Form
Expand All @@ -49,7 +48,6 @@ class ChargeDetailsController @Inject()(override val messagesApi: MessagesApi,
formProvider: ChargeDetailsFormProvider,
val controllerComponents: MessagesControllerComponents,
deleteChargeHelper: DeleteChargeHelper,
config: FrontendAppConfig,
view: ChargeDetailsView)(implicit ec: ExecutionContext)
extends FrontendBaseController
with I18nSupport {
Expand Down Expand Up @@ -94,12 +92,6 @@ class ChargeDetailsController @Inject()(override val messagesApi: MessagesApi,
.bindFromRequest()
.fold(
formWithErrors => {
val viewModel = GenericViewModel(
submitUrl = routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version).url,
returnUrl = controllers.routes.ReturnToSchemeDetailsController.returnToSchemeDetails(srn, startDate, accessType, version).url,
schemeName = schemeName
)

Future.successful(BadRequest(view(formWithErrors.copy(errors = formWithErrors.errors.distinct),
schemeName,
routes.ChargeDetailsController.onSubmit(mode, srn, startDate, accessType, version),
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/chargeF/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package controllers.chargeF

import connectors.SchemeDetailsConnector
import connectors.cache.UserAnswersCacheConnector
import controllers.actions._
import models.LocalDateBinder._
import models.{AccessType, NormalMode}
Expand All @@ -31,7 +29,6 @@ import views.html.chargeF.WhatYouWillNeedView

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.ExecutionContext

class WhatYouWillNeedController @Inject()(
override val messagesApi: MessagesApi,
Expand All @@ -40,11 +37,9 @@ class WhatYouWillNeedController @Inject()(
allowAccess: AllowAccessActionProvider,
requireData: DataRequiredAction,
val controllerComponents: MessagesControllerComponents,
schemeDetailsConnector: SchemeDetailsConnector,
userAnswersCacheConnector: UserAnswersCacheConnector,
navigator: CompoundNavigator,
view: WhatYouWillNeedView
)(implicit ec: ExecutionContext)
)
extends FrontendBaseController
with I18nSupport {

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/chargeG/WhatYouWillNeedController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController

import java.time.LocalDate
import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.Future
import views.html.chargeG.WhatYouWillNeedView

class WhatYouWillNeedController @Inject()(
Expand All @@ -40,7 +40,7 @@ class WhatYouWillNeedController @Inject()(
val controllerComponents: MessagesControllerComponents,
whatYouWillNeedView: WhatYouWillNeedView,
navigator: CompoundNavigator
)(implicit ec: ExecutionContext)
)
extends FrontendBaseController
with I18nSupport {

Expand Down
Loading

0 comments on commit 948e03f

Please sign in to comment.