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

National Minimum Wage 1 April 2016 #2423

Merged
merged 27 commits into from
Apr 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b156661
Update copy in landing page for employee flow.
pmanrubia Mar 29, 2016
229e8a5
Remove `current_payment_april_2016` option from Q1
pmanrubia Mar 31, 2016
fbad30f
Remove `will_you_be_a_first_year_apprentice?` Question
pmanrubia Mar 31, 2016
a20c0c5
Simplify age title precalculation
pmanrubia Mar 31, 2016
88c1459
Remove `valid_age_for_living_wage?` validation
pmanrubia Mar 31, 2016
13d510d
Simplify logic conditionals in view `current_payment_above`
pmanrubia Mar 31, 2016
0923bcd
Remove conditional branch in `current_payment_above` view
pmanrubia Mar 31, 2016
83a300a
Removes `what_to_check` parameter from flow.
pmanrubia Mar 31, 2016
4d4659a
Remove `does_not_apply_to_first_year_apprentices` outcome.
pmanrubia Mar 31, 2016
349dc89
Update options copy of Question: `what_would_you_like_to_check`
pmanrubia Mar 31, 2016
2203647
Update regression tests for `am-i-getting-national-wage`
pmanrubia Mar 31, 2016
593d82a
Regenerate responses and expected results
pmanrubia Mar 31, 2016
1d5f9b4
Update integration test for `am-i-getting-minimum-wage`
pmanrubia Mar 31, 2016
aaf5409
Update checksum files for `am-i-getting-minimum-wage`
pmanrubia Mar 31, 2016
8dfa590
Use capital letters in `national living wage`
pmanrubia Mar 31, 2016
68a6bf0
Update `minimum_hourly_rate` with the living wage value.
pmanrubia Mar 31, 2016
d4cfcf1
Update outcome views to support new logic.
pmanrubia Mar 31, 2016
cbcb4af
Update questions and responses for `am_i_minimum_wage`
pmanrubia Mar 31, 2016
42e2957
Update artefacts for `am-i-getting-minimum-wage`
pmanrubia Mar 31, 2016
4d2fcf6
Remove `what_to_check` from `minimum-wage-calculator-employers` flow
pmanrubia Mar 31, 2016
c6a1595
Removes `what_to_check` attribute from calculator.
pmanrubia Mar 31, 2016
bb224ea
Update copy in landing page for the employer flow.
pmanrubia Mar 31, 2016
4cd2df9
Update copy of Q1 `what_would_you_like_to_check`
pmanrubia Mar 31, 2016
393d133
Update outcome views to support new logic for employers flow
pmanrubia Mar 31, 2016
5035fe9
Generate artefacts for `minimum-wage-calculator-employers`
pmanrubia Apr 1, 2016
40b3e80
Regenerate checksums for `minimum-wage-calculator-employers`
pmanrubia Apr 1, 2016
56e9c53
Update checksums for `am-i-getting-minimum-wage`
pmanrubia Apr 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions lib/smart_answer/calculators/minimum_wage_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ class MinimumWageCalculator
attr_accessor :age, :pay_frequency, :basic_hours, :basic_pay, :is_apprentice,
:overtime_hours, :overtime_hourly_rate, :accommodation_cost

attr_reader :date, :what_to_check
attr_reader :date

def initialize(params = {})
@age = params[:age]
@date = (params[:date].nil? ? Date.today : params[:date])
@basic_hours = params[:basic_hours].to_f
@basic_pay = params[:basic_pay].to_f
@what_to_check = params[:what_to_check]
@is_apprentice = params[:is_apprentice]
@pay_frequency = params[:pay_frequency] || 7
@overtime_hours = params[:overtime_hours].to_i || 0
Expand Down Expand Up @@ -74,7 +73,11 @@ def minimum_hourly_rate
if @is_apprentice
@minimum_wage_data[:apprentice_rate]
else
per_hour_minimum_wage
if eligible_for_living_wage?
national_living_wage_rate
else
per_hour_minimum_wage
end
end
end

Expand Down
39 changes: 3 additions & 36 deletions lib/smart_answer_flows/am-i-getting-minimum-wage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ def define
multiple_choice :what_would_you_like_to_check? do
option "current_payment"
option "past_payment"
option "current_payment_april_2016"

calculate :calculator do |response|
Calculators::MinimumWageCalculator.new(what_to_check: response)
calculate :calculator do
Calculators::MinimumWageCalculator.new
end

calculate :accommodation_charge do
Expand All @@ -24,52 +23,22 @@ def define
case response
when 'current_payment'
question :are_you_an_apprentice?
when 'current_payment_april_2016'
question :will_you_be_a_first_year_apprentice?
when 'past_payment'
question :past_payment_date?
end
end
end

# Q2 - April 2016
multiple_choice :will_you_be_a_first_year_apprentice? do
option :yes
option :no

next_node do |response|
case response
when 'yes'
calculator.is_apprentice = true
outcome :does_not_apply_to_first_year_apprentices
when 'no'
question :how_old_are_you? #Q3
end
end
end

# Q3
value_question :how_old_are_you?, parse: Integer do
precalculate :age_title do
if calculator.what_to_check == 'current_payment_april_2016'
"How old will you be on 1 April 2016?"
else
"How old are you?"
end
"How old are you?"
end

validate do |response|
calculator.valid_age?(response)
end

validate :valid_age_for_living_wage? do |response|
if calculator.what_to_check == 'current_payment_april_2016'
calculator.valid_age_for_living_wage?(response)
else
true
end
end

next_node do |response|
calculator.age = response
if calculator.under_school_leaving_age?
Expand All @@ -81,8 +50,6 @@ def define
end

use_shared_logic "minimum_wage"

outcome :does_not_apply_to_first_year_apprentices
end
end
end
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<% content_for :title do %>
National Minimum Wage calculator for workers
Minimum wage calculator for workers
<% end %>

<% content_for :meta_description do %>
Check if your pay matches the National Minimum Wage, the national living wage or if your employer owes you payments from past years.
Check if your pay matches the National Minimum Wage, the National Living Wage or if your employer owes you payments from past years.
<% end %>

<% content_for :body do %>
Check if your pay matches the National Minimum Wage or if your employer owes you payments from past years.
Check if:

You can also check if you'll get the national living wage from 1 April 2016.
- you’re getting paid the National Minimum Wage
- you’re getting paid the National Living Wage
- your employer owes you past payments from past years

^You must be at least 25 years old to get the national living wage.^
^You must be at least 25 years old to get the National Living Wage.^
<% end %>
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
<% content_for :body do %>
$C
<% if calculator.what_to_check == 'current_payment_april_2016' && calculator.eligible_for_living_wage? %>
<% if calculator.living_wage_or_above? %>
You will be getting the national living wage
<% else %>
You are getting the National Minimum wage but your pay should be increased to at least the national living wage from 1 April 2016.
<% end %>
<% if calculator.eligible_for_living_wage? %>
You are getting the National Living Wage.
<% else %>
You are getting the National Minimum Wage.
<% end %>
$C

<% if calculator.what_to_check == 'current_payment_april_2016' && calculator.eligible_for_living_wage? %>
The national living wage per hour for your age will be | Your actual pay
<% else %>
The National Minimum Wage per hour for your age | Your actual pay
<% end %>
<% if calculator.eligible_for_living_wage? %>
The National Living Wage per hour for your age | Your actual pay
- | -
<% if calculator.what_to_check == 'current_payment_april_2016' && calculator.eligible_for_living_wage? %>
<%= format_money(calculator.national_living_wage_rate) %> | <%= format_money(calculator.total_hourly_rate) %>
<% else %>
The National Minimum Wage per hour for your age | Your actual pay
- | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %>
<% end %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<% content_for :body do %>
$C
You aren't getting the National Minimum Wage.
<% if calculator.eligible_for_living_wage? %>
You aren't getting the National Living Wage.
<% else %>
You aren't getting the National Minimum Wage.
<% end %>
$C

The National Minimum Wage per hour for your age | Your actual pay | For each pay period your employer owes you
- | - | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% if calculator.eligible_for_living_wage? %>
The National Living Wage per hour for your age | Your actual pay | For each pay period your employer owes you
- | - | -
<%= format_money(calculator.national_living_wage_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% else %>
The National Minimum Wage per hour for your age | Your actual pay | For each pay period your employer owes you
- | - | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% end %>

\* This figure has been rounded to the nearest penny.

^Your actual pay should increase to at least £7.20 per hour from 1 April 2016.^

If you work overtime or your employer provides you with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

<%= render partial: 'shared/minimum_wage/acas_information.govspeak.erb' %>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Please enter a whole number greater than 0
<% end %>
<% content_for :valid_age_for_living_wage? do %>
You must be 25 or over to get the national living wage
You must be 25 or over to get the National Living Wage
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<% end %>

<% options(
"current_payment": "If you're getting the National Minimum Wage (from October 2015)",
"past_payment": "If an employer owes you past payments (before October 2015)",
"current_payment_april_2016": "If you'll get the national living wage (from 1 April 2016)"
"current_payment": "If you're getting the National Minimum Wage (from October 2015) or the National Living Wage (from April 2016)",
"past_payment": "If an employer owes you past payments (before October 2015)"
) %>

This file was deleted.

4 changes: 2 additions & 2 deletions lib/smart_answer_flows/minimum-wage-calculator-employers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def define
option "current_payment"
option "past_payment"

calculate :calculator do |response|
Calculators::MinimumWageCalculator.new(what_to_check: response)
calculate :calculator do
Calculators::MinimumWageCalculator.new
end

calculate :accommodation_charge do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<% content_for :title do %>
National Minimum Wage calculator for employers
Minimum wage calculator for employers
<% end %>

<% content_for :meta_description do %>
Check if you're paying a worker the National Minimum Wage or if you owe them payments from past years.
Check if youre paying a worker the National Minimum Wage, the National Living Wage or if you owe them payments for past years.
<% end %>

<% content_for :body do %>
Check if you're paying a worker the National Minimum Wage or if you owe them payments from past years.
Check if:

- you’re paying a worker the National Minimum Wage
- you’re paying a worker the National Living Wage
- you owe your employee payments from previous years

^Your employee must be at least 25 years old to get the national living wage.^
<% end %>
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<% content_for :body do %>
$C
You are paying the National Minimum Wage.
<% if calculator.eligible_for_living_wage? %>
You are paying the National Living Wage.
<% else %>
You are paying the National Minimum Wage.
<% end %>
$C

The National Minimum Wage per hour for the worker’s age | The worker’s actual pay
- | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %>
<% if calculator.eligible_for_living_wage? %>
The National Living Wage per hour for the worker’s age | The worker’s actual pay
- | -
<%= format_money(calculator.national_living_wage_rate) %> | <%= format_money(calculator.total_hourly_rate) %>
<% else %>
The National Minimum Wage per hour for the worker’s age | The worker’s actual pay
- | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %>
<% end %>


If the worker works overtime or you provide them with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<% content_for :body do %>
$C
You aren't paying the National Minimum Wage.
<% if calculator.eligible_for_living_wage? %>
You aren't paying the National Living Wage.
<% else %>
You aren't paying the National Minimum Wage.
<% end %>
$C

The National Minimum Wage per hour for the worker’s age | The worker’s actual pay | For each pay period you owe the worker
- | - | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% if calculator.eligible_for_living_wage? %>
The National Living Wage per hour for the worker’s age | The worker’s actual pay | For each pay period you owe the worker
- | - | -
<%= format_money(calculator.national_living_wage_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% else %>
The National Minimum Wage per hour for the worker’s age | The worker’s actual pay | For each pay period you owe the worker
- | - | -
<%= format_money(calculator.minimum_hourly_rate) %> | <%= format_money(calculator.total_hourly_rate) %> * | <%= format_money(calculator.total_underpayment) %>
<% end %>


\* This figure has been rounded to the nearest penny.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<% end %>

<% options(
"current_payment": "If you’re paying a worker the National Wage (from October 2015)",
"current_payment": "If you’re paying a worker the National Minimum Wage (from October 2015) or the National Living Wage (from April 2016)",
"past_payment": "If you owe a worker past payments (before October 2015)"
) %>
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
National Minimum Wage calculator for workers
Minimum wage calculator for workers

Check if your pay matches the National Minimum Wage or if your employer owes you payments from past years.
Check if:

You can also check if you'll get the national living wage from 1 April 2016.
- you’re getting paid the National Minimum Wage
- you’re getting paid the National Living Wage
- your employer owes you past payments from past years

^You must be at least 25 years old to get the national living wage.^
^You must be at least 25 years old to get the National Living Wage.^



6 changes: 3 additions & 3 deletions test/artefacts/am-i-getting-minimum-wage/current_payment.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link rel="stylesheet" media="all" href="/smartanswers/application.css" />
<link rel="stylesheet" media="print" href="/smartanswers/print.css" />
<title>National Minimum Wage calculator for workers - GOV.UK</title>
<title>Minimum wage calculator for workers - GOV.UK</title>
<script src="/smartanswers/smart-answers.js" defer="defer"></script>
<meta name="robots" content="noindex">

Expand All @@ -22,7 +22,7 @@
<header class="page-header group">
<div>
<h1>
National Minimum Wage calculator for workers
Minimum wage calculator for workers
</h1>
</div>
</header>
Expand Down Expand Up @@ -93,7 +93,7 @@ <h3 class="previous-answers-title">
<tr class="section">
<td class="previous-question-title">What would you like to check?</td>
<td class="previous-question-body">
If you're getting the National Minimum Wage (from October 2015)</td>
If you're getting the National Minimum Wage (from October 2015) or the National Living Wage (from April 2016)</td>

<td class="link-right">
<a href="/am-i-getting-minimum-wage/y?previous_response=current_payment">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The National Minimum Wage per hour for your age | Your actual pay | For each pay

\* This figure has been rounded to the nearest penny.

^Your actual pay should increase to at least £7.20 per hour from 1 April 2016.^

If you work overtime or your employer provides you with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

This result is an estimate. If you have any questions, call the confidential helpline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The National Minimum Wage per hour for your age | Your actual pay | For each pay

\* This figure has been rounded to the nearest penny.

^Your actual pay should increase to at least £7.20 per hour from 1 April 2016.^

If you work overtime or your employer provides you with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

This result is an estimate. If you have any questions, call the confidential helpline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The National Minimum Wage per hour for your age | Your actual pay | For each pay

\* This figure has been rounded to the nearest penny.

^Your actual pay should increase to at least £7.20 per hour from 1 April 2016.^

If you work overtime or your employer provides you with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

This result is an estimate. If you have any questions, call the confidential helpline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The National Minimum Wage per hour for your age | Your actual pay | For each pay

\* This figure has been rounded to the nearest penny.

^Your actual pay should increase to at least £7.20 per hour from 1 April 2016.^

If you work overtime or your employer provides you with [accommodation](/national-minimum-wage-accommodation), this has been added to the calculation.

This result is an estimate. If you have any questions, call the confidential helpline.
Expand Down
Loading