From 50ee3d0390d9638a4c513b56797facc1b4af917f Mon Sep 17 00:00:00 2001 From: jesskay2 <114414761+jesskay2@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:44:06 +0000 Subject: [PATCH] DDCNL-9229 | Removed BarChartCalculator.scala --- .../nisp/views/includes/BarChart.scala.html | 1 - .../nisp/views/utils/BarChartCalculator.scala | 32 ------------------- .../statePension/StatePensionViewSpec.scala | 28 ++++++++-------- 3 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 app/uk/gov/hmrc/nisp/views/utils/BarChartCalculator.scala diff --git a/app/uk/gov/hmrc/nisp/views/includes/BarChart.scala.html b/app/uk/gov/hmrc/nisp/views/includes/BarChart.scala.html index 9713c7ad..afeeb03f 100644 --- a/app/uk/gov/hmrc/nisp/views/includes/BarChart.scala.html +++ b/app/uk/gov/hmrc/nisp/views/includes/BarChart.scala.html @@ -15,7 +15,6 @@ *@ @import uk.gov.hmrc.nisp.views.html.includes.newComponents.{P, H3} -@import uk.gov.hmrc.nisp.views.utils.BarChartCalculator @import uk.gov.hmrc.nisp.views.formatting.NispMoney @this() diff --git a/app/uk/gov/hmrc/nisp/views/utils/BarChartCalculator.scala b/app/uk/gov/hmrc/nisp/views/utils/BarChartCalculator.scala deleted file mode 100644 index 5ab15f3c..00000000 --- a/app/uk/gov/hmrc/nisp/views/utils/BarChartCalculator.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 uk.gov.hmrc.nisp.views.utils - -object BarChartCalculator { - - def barPercentage(greenBar: BigDecimal, greyBar: BigDecimal): BigDecimal = { - if ((greenBar / greyBar) * 100 > 100) 100 else (greenBar / greyBar) * 100 - } - - def forecastMax(greenBar: BigDecimal, greyBar: BigDecimal): BigDecimal = { - if (greenBar > greyBar) greyBar else greenBar - } - - def findMaxPensionAmount(spMaximumAmount: BigDecimal, vnicPensionAmount: BigDecimal): BigDecimal = - Math.max(spMaximumAmount.toDouble, vnicPensionAmount.toDouble) - -} diff --git a/test/uk/gov/hmrc/nisp/views/statePension/StatePensionViewSpec.scala b/test/uk/gov/hmrc/nisp/views/statePension/StatePensionViewSpec.scala index c6700e15..37683af2 100644 --- a/test/uk/gov/hmrc/nisp/views/statePension/StatePensionViewSpec.scala +++ b/test/uk/gov/hmrc/nisp/views/statePension/StatePensionViewSpec.scala @@ -163,7 +163,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -617,7 +617,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -958,7 +958,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -1565,7 +1565,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -1850,7 +1850,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -1995,7 +1995,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2136,7 +2136,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2284,7 +2284,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2436,7 +2436,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2587,7 +2587,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2737,7 +2737,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -2890,7 +2890,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -3046,7 +3046,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false ) @@ -3323,7 +3323,7 @@ class StatePensionViewSpec NationalInsuranceTaxYearBuilder("2015-16", underInvestigation = false), NationalInsuranceTaxYearBuilder("2014-15", qualifying = false, underInvestigation = false), - NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) /*payable = true*/ + NationalInsuranceTaxYearBuilder("2013-14", underInvestigation = false) ), reducedRateElection = false )