-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix state pension topup 2017 birthday bug #2909
Conversation
766b95d
to
cd7373c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leenagupte is there a reason for adding the if age >= retirement_age(gender)
guard.?? it appears redundant
@ikennaokpala I copied the line to append a row from the loop directly above it. As it's a short-term hack I didn't put any thought into what the guard is needed for. |
Agree with @ikennaokpala's point, but we are going to retire this Smart Answer in a few weeks... let's move to fact-check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved as this is going to be retired in a few weeks, and it seems to fix an existing bug.
9de0009
to
d549481
Compare
This pull request is trying to replicate and fix a bug that occurs if your birthday falls in the last 3 months of the scheme. Updating the current time for the regression tests allows us to baseline regression test content with what is currently on the live system. Future commits should see this content change.
The state pension popup calculator is supposed to show you how large of a lump sum payment you need to make to popup your weekly pension. This lump sum changes depending on how old you are. So, you would pay smaller lump sum when you are 70 years old than when you are 69. The potential lump sums displayed to the user, shows them a list of payments they can make at each age. e.g. £18,450 when you’re 72 £17,975 when you’re 73 The code to generate this churns out one payment amount per calendar year. This seemed ok because you only have one birthday a year, and could therefore only make one payment. There was a problem with this though. The final year of the scheme, 2017, only runs from 1st January to 5th April. If you birthday is after 6th April, everything is fine. You can only make a payment based on your current age. However, if your birthday happens to fall between these 3 months, you could potentially make a lower lump sum payment on or after your next birthday. The calculator did not handle this last scenario. I’ve added an ugly hack to get around this problem. The calculator is being retired in 2 months, so it doesn’t seem worth the effort to come up with a more elegant solution.
The test artefacts are updated as expected.
d549481
to
3d0de3b
Compare
The state-pension-topup calculator should only show one topup age if the user doesn't have any more birthdays before the scheme ends. The original loop to get the number of birthdays, works out how old you are going to turn in a calendar year. For the final year of the scheme, this needs to be amended to be how old you are going to turn in the first 3 months of the year, and if you have a birthday in the first 3 months, it should take into account whether your birthday has already passed or not. That wasn't happening with the previous hack. If your birthday is between 1st January and 5th April it was showing two ages, regardless of whether you'd already celebrated your birthday.
3d0de3b
to
bfb8908
Compare
Trello card: https://trello.com/c/M542k4eW
Motivation
The state pension popup calculator is supposed to show you how large of a lump sum payment you need to make to popup your weekly pension.
This lump sum changes depending on how old you are. So, you would pay smaller lump sum when you are 70 years old than when you are 69.
The potential lump sums displayed to the user, shows them a list of payments they can make at each age.
e.g.
£18,450 when you’re 72
£17,975 when you’re 73
The code to generate this churns out one payment amount per calendar year. This seemed ok because you only have one birthday a year, and could therefore only make one payment.
There was a problem with this though. The final year of the scheme, 2017, only runs from 1st January to 5th April. If you birthday is after 6th April, everything is fine. You can only make a payment based on your current age.
However, if your birthday happens to fall between these 3 months, you could potentially make a lower lump sum payment on or after your next birthday.
The calculator did not handle this last scenario.
I’ve added an ugly hack to get around this problem. The calculator is being retired in 2 months, so it doesn’t seem worth the effort to come up with a more elegant solution.
Factcheck
state-pension-topup
Expected changes
Before
After