Skip to content
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

Update National Minimum Wage for past values when over 25 #2439

Merged
merged 11 commits into from
Apr 6, 2016

Conversation

pmanrubia
Copy link
Contributor

@pmanrubia pmanrubia force-pushed the national-minimum-wage-update branch from 7b76c2e to 1eaa426 Compare April 6, 2016 00:11
@pmanrubia pmanrubia changed the title [WIP] Update National Minimum Wage for past values when over 25 Update National Minimum Wage for past values when over 25 Apr 6, 2016
@@ -161,6 +161,12 @@ class MinimumWageCalculatorTest < ActiveSupport::TestCase
assert !@calculator.eligible_for_living_wage?
end
end

should 'return false if age is over 25, and date is before 2016-04-01' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: The narrative here I feel should read thus:
ruby should 'return false if age is over 25, and date is on or before 2016-04-01' do

This is based on line 174 in lib/smart_answer/calculators/minimum_wage_calculator.rb

@ikennaokpala
Copy link
Contributor

@pmanrubia Apart from the test narratives here.. This PR LGTM

pmanrubia added 11 commits April 6, 2016 11:02
PR #2423 included an issue when calculating the minimum wage for past 
years if the user is over 25. The returned value is £7.20, which is the 
minimum living wage, and it should be calculated according to the
the yaml file.

This commit revert the artefacts as a firs step to fix this issue.
This way we can start fresh, so any change on the artefacts can be
checked against a working version.
This value was introduced as a way to exercise code for outcomes:
`current_payment_above.govspeak` and `current_payment_below.govspeak`

Unfortunately, as the date is fixed to 2015-01-01, there is no point
in creating new paths in the flow, as they would not be adding value.
This integration test was added to cover the scenario when the user
is 24 and the current date is > 2016-04-01

Unfortunately, this date was fixed on 2015-01-01, so this scenario
is not adding value.
This method is no longer used, so it can be safely removed.
A user is eligible for living wage only when:
- Is over 25 years old
- The reference date is 2016-04-01
Previous implementation had the value hardcoded to 7.2
This commit uses the `national_hourly_rate` method because they both share
the same values in the yaml file.

This will be valid until October. So a more robust solution should
be put in place. This improvement would be out of the scope of this PR
because of a strict deadline.
`minimum_hourly_rate` in the calculator relies on the yaml file to
do calculations. The reason is: after 2015-10-01 the national minimum
wage and the national living wage share the same values. 
This could change, though, in October.

The yaml file with the rates have been update to calculate the 
minimum living wage for users over 25.

Due to the strict deadline no further refactoring is done.
@pmanrubia pmanrubia force-pushed the national-minimum-wage-update branch from 1eaa426 to a955989 Compare April 6, 2016 10:08
@pmanrubia
Copy link
Contributor Author

Hi @ikennaokpala thanks for your quick review. I have updated with your comments. I have also rebased and pushed in preparation for merging.

@ikennaokpala
Copy link
Contributor

@pmanrubia great use of refute reads better now

@pmanrubia pmanrubia merged commit edc20fe into master Apr 6, 2016
@pmanrubia pmanrubia deleted the national-minimum-wage-update branch April 6, 2016 11:40
@@ -136,7 +136,10 @@
:max_age: 21
:rate: 5.30
- :min_age: 21
:max_age: 1000
:max_age: 24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MarriageAbroadCalculator#per_hour_minimum_wage method uses @age < r[:max_age] which means this rate isn't picked up for people aged 24. I've created PR #2441 to fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants