diff --git a/changelog.d/2683.fixed.md b/changelog.d/2683.fixed.md new file mode 100644 index 0000000000..c211fbbf4e --- /dev/null +++ b/changelog.d/2683.fixed.md @@ -0,0 +1 @@ +Apply the apprentice minimum wage only to apprentices under 19 or explicitly in their first 12 months, including historical calculations from October 2012, while preserving employer National Insurance relief for later-year apprentices under 25. diff --git a/docs/book/usage/simulations.md b/docs/book/usage/simulations.md index 8aae94a017..d60c196479 100644 --- a/docs/book/usage/simulations.md +++ b/docs/book/usage/simulations.md @@ -90,6 +90,59 @@ marginal_tax_rate = sim.calculate("marginal_tax_rate", 2025) These calculations return arrays because simulations can handle multiple people, benefit units or households simultaneously. Each variable gives you results at the appropriate level - income tax is calculated per person, Universal Credit per benefit unit, and council tax per household. ``` +## Apprenticeship inputs + +Apprentice status and entitlement to the apprentice minimum wage use separate +annual person inputs: + +- `is_apprentice` records apprentice status and continues to determine the + apprentice employer National Insurance relief, subject to its age limit. +- `is_in_first_year_of_apprenticeship` records whether the person is within + the first 12 months of the current apprenticeship employment. It defaults + to `False`; it does not establish apprentice status on its own. + +The apprentice minimum wage applies when `is_apprentice` is true and the +person is either under 19 or has the first-year input set to true. Both +`minimum_wage` and `minimum_wage_category` use this rule. At age 19 or over, +an apprentice with a false or omitted first-year input uses the ordinary +age-related rate. A later-year apprentice under 25 can therefore retain +employer National Insurance relief while using the ordinary minimum wage. + +The first 12 months refer to the current apprenticeship employment, rather +than an academic or training-provider year. Employment with a previous +employer counts where statutory continuity is preserved. A genuinely +separate apprenticeship contract starts a new period, as explained in +[HMRC's apprenticeship contract guidance](https://www.gov.uk/hmrc-internal-manuals/national-minimum-wage-manual/nmwm05300) +and [regulation 5](https://www.legislation.gov.uk/uksi/2015/621/regulation/5). + +For example, the person inputs for a 22-year-old in the first 12 months are: + +```python +"parent": { + "age": {2026: 22}, + "is_apprentice": {2026: True}, + "is_in_first_year_of_apprenticeship": {2026: True}, + "employment_income": {2026: 8_000}, +} +``` + +Previously, setting only `is_apprentice` selected the apprentice minimum +wage at every age. Existing callers must now supply the first-year input +for apprentices aged 19 or over who qualify for that rate. Missing tenure +does not establish that someone has completed 12 months; the false default +avoids assuming eligibility for the lower rate. The distinction also affects +the minimum-income conditions for Tax-Free Childcare, extended childcare +entitlement and the Childcare Offer for Wales. + +These inputs classify the model's annual period. The model does not infer +an apprenticeship start date, change the classification at a birthday or +anniversary within the year, or advance apprenticeship tenure during dataset +projection. Callers must supply the classification for each modelled year. +Annual minimum-wage calculations retain the existing fiscal-year conversion: +the model uses the rate in force on 30 April for the whole labelled year. +This change does not introduce a pay-reference-period calculation or alter +the dated rate parameters. + ## Simulating policy scenarios To test policy changes, create a scenario and apply it to your simulation. This example shows what happens when we increase Universal Credit's standard allowance for single people over 25 from the current rate to £500 per month: diff --git a/docs/engineering/skills/dataset-sources.md b/docs/engineering/skills/dataset-sources.md index bcefc68c73..600d59943c 100644 --- a/docs/engineering/skills/dataset-sources.md +++ b/docs/engineering/skills/dataset-sources.md @@ -100,6 +100,32 @@ discard H5 attributes must explicitly preserve this declaration before their output can be reloaded safely. Test routing and migration on synthetic frames and small H5 fixtures, without downloading private datasets. +## Apprenticeship status and tenure + +Dataset producers should export `is_apprentice` and +`is_in_first_year_of_apprenticeship` as separate annual person columns. +Apprentice status alone cannot establish entitlement to the apprentice +minimum wage at age 19 or over. The first-year column records the first +12 months of the current apprenticeship employment, including any period +covered by statutory continuity; it is not an academic-year flag. See the +[calculator input contract](../../book/usage/simulations.md#apprenticeship-inputs). + +An absent first-year column uses the variable's `False` default. This can +change minimum-wage and dependent childcare income-condition results for +existing data whose `is_apprentice` flag is true at age 19 or over. It does +not change the existing under-25 apprentice employer National Insurance +relief. A missing column is not evidence that every apprentice is in a +later year. + +The producer work in [Microcosm PR #1373](https://github.com/PolicyEngine/microcosm/pull/1373) +must supply an explicit first-year classification alongside apprentice +status before that status can also identify older apprentices who receive +the lower minimum wage. This UK change supplies no first-year imputation, +prevalence estimate or migration of existing releases. Projection does not +advance apprenticeship tenure, so a producer or caller must supply changed +classifications for later years rather than rely on a carried input to +expire automatically. + ## Defaults `policyengine_uk` does not silently choose a default dataset when no situation is diff --git a/policyengine_uk/parameters/gov/hmrc/minimum_wage/apprentice_age_limit.yaml b/policyengine_uk/parameters/gov/hmrc/minimum_wage/apprentice_age_limit.yaml new file mode 100644 index 0000000000..e0fb338fa6 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/minimum_wage/apprentice_age_limit.yaml @@ -0,0 +1,18 @@ +description: Apprentices below this age qualify for the apprentice minimum wage regardless of how long they have been in their apprenticeship. +# The under-19 rule took effect on 1 October 2010. Values begin with the +# model's minimum wage rate history on 1 October 2012. +values: + 2012-10-01: 19 +metadata: + label: Apprentice minimum wage age limit + unit: year + period: year + reference: + - title: The National Minimum Wage Regulations 1999 (Amendment) Regulations 2010, regulation 5 (substituted regulation 13(3)(b)) + href: https://www.legislation.gov.uk/uksi/2010/1901/regulation/5/made + - title: The National Minimum Wage Regulations 1999 (Amendment) Regulations 2010, regulation 1 + href: https://www.legislation.gov.uk/uksi/2010/1901/regulation/1/made + - title: The National Minimum Wage Regulations 2015, regulation 5(1)(b) + href: https://www.legislation.gov.uk/uksi/2015/621/regulation/5 + - title: The National Minimum Wage Regulations 2015, regulation 1 + href: https://www.legislation.gov.uk/uksi/2015/621/regulation/1 diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/income/income_floor/uc_minimum_income_floor.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/income/income_floor/uc_minimum_income_floor.yaml index 0132b689f6..6b62c34307 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/income/income_floor/uc_minimum_income_floor.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/income/income_floor/uc_minimum_income_floor.yaml @@ -33,6 +33,7 @@ input: age: 30 is_apprentice: true + is_in_first_year_of_apprenticeship: true output: # Reg. 90(2) names NMW Regs reg. 4 and 4A(1)(a) to (c); the # apprenticeship rate of 8.00 (reg. 4A(1)(d)) would give 14,560. diff --git a/policyengine_uk/tests/policy/baseline/finance/income/apprentice_minimum_wage.yaml b/policyengine_uk/tests/policy/baseline/finance/income/apprentice_minimum_wage.yaml new file mode 100644 index 0000000000..7731cdeea1 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/finance/income/apprentice_minimum_wage.yaml @@ -0,0 +1,395 @@ +# NMW Regulations 2015 reg. 5: an apprentice aged 19 or over who has +# completed the first 12 months receives the rate for their age. Omitting +# first-year status must not extend the apprentice rate to older apprentices. +# In 2026 the 21+ rate is 12.71, versus the apprentice rate of 8.00: +# https://www.gov.uk/national-minimum-wage-rates +# +# Earnings of 8,000 a year are 2,000 in a 13-week declaration period: +# below 12.71 x 16 x 13 = 2,643.68, but above 8 x 16 x 13 = 1,664. +# The Welsh weekly test is equivalent: 8,000 / 52 = 153.85 is below +# 12.71 x 16 = 203.36, but above 8 x 16 = 128. + +- name: Case 1, an older apprentice without first-year status fails the Tax-Free Childcare minimum income condition. + period: 2026 + input: + people: + person1: + age: 22 + is_apprentice: true + employment_income: 8_000 + person2: + age: 3 + benunits: + benunit: + members: [person1, person2] + households: + household: + members: [person1, person2] + region: WALES + output: + tax_free_childcare_meets_income_requirements: [false, false] + +- name: Case 2, an older apprentice without first-year status fails the extended childcare minimum income condition. + period: 2026 + input: + people: + person1: + age: 22 + is_apprentice: true + employment_income: 8_000 + person2: + age: 3 + benunits: + benunit: + members: [person1, person2] + households: + household: + members: [person1, person2] + region: WALES + output: + extended_childcare_entitlement_meets_income_requirements: [false, false] + +- name: Case 3, an older apprentice without first-year status fails the Childcare Offer for Wales parent condition. + period: 2026 + input: + people: + person1: + age: 22 + is_apprentice: true + employment_income: 8_000 + person2: + age: 3 + benunits: + benunit: + members: [person1, person2] + households: + household: + members: [person1, person2] + region: WALES + output: + wales_childcare_offer_parent_condition: [false, false] + +- name: Case 4, the apprentice rate ends at age 19 after the first year. + period: 2026 + input: + age: [18, 19, 22, 30] + is_apprentice: [true, true, true, true] + is_in_first_year_of_apprenticeship: [false, false, false, false] + output: + qualifies_for_apprentice_minimum_wage: [true, false, false, false] + minimum_wage: [8, 10.85, 12.71, 12.71] + minimum_wage_category: [APPRENTICE, BETWEEN_18_20, BETWEEN_21_22, OVER_24] + +- name: Case 5, the first-year condition gives older apprentices the apprentice rate. + period: 2026 + input: + age: [19, 22, 30] + is_apprentice: [true, true, true] + is_in_first_year_of_apprenticeship: [true, true, true] + output: + qualifies_for_apprentice_minimum_wage: [true, true, true] + minimum_wage: [8, 8, 8] + minimum_wage_category: [APPRENTICE, APPRENTICE, APPRENTICE] + +- name: Case 6, first-year status alone does not give non-apprentices the apprentice rate. + period: 2026 + input: + age: [18, 22, 30] + is_apprentice: [false, false, false] + is_in_first_year_of_apprenticeship: [true, true, true] + output: + qualifies_for_apprentice_minimum_wage: [false, false, false] + minimum_wage: [10.85, 12.71, 12.71] + minimum_wage_category: [BETWEEN_18_20, BETWEEN_21_22, OVER_24] + +- name: Case 7, omitted first-year status defaults to false without overriding age-based qualification. + period: 2026 + input: + age: [18, 19, 22] + is_apprentice: [true, true, true] + output: + is_in_first_year_of_apprenticeship: [false, false, false] + qualifies_for_apprentice_minimum_wage: [true, false, false] + minimum_wage: [8, 10.85, 12.71] + minimum_wage_category: [APPRENTICE, BETWEEN_18_20, BETWEEN_21_22] + +- name: Case 8, an older apprentice after the first year receives the 2025 age-based rate. + period: 2025 + input: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + output: + qualifies_for_apprentice_minimum_wage: false + minimum_wage: 12.21 + minimum_wage_category: BETWEEN_21_22 + +- name: Case 9, a first-year apprentice parent meets all three childcare income conditions at 8000 a year. + period: 2026 + input: + people: + person1: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: true + employment_income: 8_000 + person2: + age: 3 + benunits: + benunit: + members: [person1, person2] + households: + household: + members: [person1, person2] + region: WALES + output: + minimum_wage: [8, 8] + minimum_wage_category: [APPRENTICE, UNDER_18] + tax_free_childcare_expected_declaration_period_income: [2_000, 0] + tax_free_childcare_meets_income_requirements: [true, false] + extended_childcare_entitlement_meets_income_requirements: [true, false] + wales_childcare_offer_parent_condition: [true, false] + wales_childcare_offer_eligible: true + +- name: Case 10, an older apprentice parent after the first year fails all three childcare income conditions at 8000 a year. + period: 2026 + input: + people: + person1: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + employment_income: 8_000 + person2: + age: 3 + benunits: + benunit: + members: [person1, person2] + households: + household: + members: [person1, person2] + region: WALES + output: + minimum_wage: [12.71, 8] + minimum_wage_category: [BETWEEN_21_22, UNDER_18] + tax_free_childcare_expected_declaration_period_income: [2_000, 0] + tax_free_childcare_meets_income_requirements: [false, false] + extended_childcare_entitlement_meets_income_requirements: [false, false] + wales_childcare_offer_parent_condition: [false, false] + wales_childcare_offer_eligible: false + +# SSCBA 1992 s.9B and HMRC NIM01307: relevant apprentices qualify for +# employer NIC relief while under 25, irrespective of apprenticeship year. +# At 30,000, ages 21 and 24 are below the 50,270 apprentice upper secondary +# threshold. From age 25 the ordinary charge is (30,000 - 5,000) x 15%. +# https://www.gov.uk/hmrc-internal-manuals/national-insurance-manual/nim01307 +- name: Case 11, employer NIC relief for apprentices uses the under-25 limit in every apprenticeship year. + period: 2026 + input: + age: [21, 21, 24, 24, 25, 25] + is_apprentice: [true, true, true, true, true, true] + is_in_first_year_of_apprenticeship: [true, false, true, false, true, false] + employment_income: [30_000, 30_000, 30_000, 30_000, 30_000, 30_000] + output: + minimum_wage: [8, 12.71, 8, 12.71, 8, 12.71] + ni_class_1_employer: [0, 0, 0, 0, 3_750, 3_750] + +# UC Regs 2013 reg. 90(2) excludes the apprentice rate from the individual +# threshold: 12.71 x 35 x 52 = 23,132.20, in either apprenticeship year. +# Regs. 82(1)(a) and 6(1A)(za) use the National Living Wage for the cap: +# floor(12.71 x 16 x 52 / 12) x 12 = 10,572. +- name: Case 12, UC minimum income floor and benefit cap thresholds keep their non-apprentice rates in every apprenticeship year. + period: 2026 + input: + age: [22, 22] + is_apprentice: [true, true] + is_in_first_year_of_apprenticeship: [true, false] + output: + minimum_wage: [8, 12.71] + uc_minimum_income_floor_gross: [23_132.20, 23_132.20] + uc_benefit_cap_earnings_exception_threshold: [10_572, 10_572] + +# End to end: the same first-year/later-year households in England and +# Wales. Their income, ages and childcare use are identical; only the +# apprenticeship year differs within each country. None receives UC or +# tax credits, so those programmes do not disqualify Tax-Free Childcare. +# Each child spends 5,000 on childcare after funded hours; 20% is 1,000. +# https://www.gov.uk/tax-free-childcare +# +# The England child turns 3 on 31 March, so all three terms have universal +# hours. The working-parent top-up is (30 - 15) x 38 = 570 hours, valued +# at the existing 2026 national-average funding proxy, 6.61: 3,767.70. +# https://www.gov.uk/government/publications/early-years-funding-2026-to-2027/2026-to-2027-early-years-national-funding-formulae-technical-note +# +# In Wales the childcare element is (30 - 10) x 39 + 30 x 9 = 1,050 hours, +# at the 6.67 provider rate from 6 April 2026: 7,003.50. +# https://www.gov.wales/written-statement-childcare-offer-rate-review +- name: Case 13, first-year status changes the final childcare awards in England and Wales. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 22 + is_parent: true + is_apprentice: true + is_in_first_year_of_apprenticeship: true + employment_income: 8_000 + person2: + age: 3 + date_of_birth: 20230331 + childcare_expenses: 5_000 + person3: + age: 22 + is_parent: true + is_apprentice: true + is_in_first_year_of_apprenticeship: false + employment_income: 8_000 + person4: + age: 3 + date_of_birth: 20230331 + childcare_expenses: 5_000 + person5: + age: 22 + is_parent: true + is_apprentice: true + is_in_first_year_of_apprenticeship: true + employment_income: 8_000 + person6: + age: 3 + date_of_birth: 20230331 + childcare_expenses: 5_000 + person7: + age: 22 + is_parent: true + is_apprentice: true + is_in_first_year_of_apprenticeship: false + employment_income: 8_000 + person8: + age: 3 + date_of_birth: 20230331 + childcare_expenses: 5_000 + benunits: + benunit1: + members: [person1, person2] + would_claim_uc: false + would_claim_CTC: false + would_claim_WTC: false + benunit2: + members: [person3, person4] + would_claim_uc: false + would_claim_CTC: false + would_claim_WTC: false + benunit3: + members: [person5, person6] + would_claim_uc: false + would_claim_CTC: false + would_claim_WTC: false + benunit4: + members: [person7, person8] + would_claim_uc: false + would_claim_CTC: false + would_claim_WTC: false + households: + household1: + members: [person1, person2] + region: NORTH_EAST + household2: + members: [person3, person4] + region: NORTH_EAST + household3: + members: [person5, person6] + region: WALES + household4: + members: [person7, person8] + region: WALES + output: + tax_free_childcare: [0, 1_000, 0, 0, 0, 1_000, 0, 0] + extended_childcare_entitlement: [3_767.70, 0, 0, 0] + wales_childcare_offer: [0, 0, 7_003.50, 0] + +# The age/first-year distinction predates the 2015 consolidation: +# S.I. 2010/1901 reg. 5 substituted NMW Regulations 1999 reg. 13(3). +# At the start of 2013 the 21+ rate was 6.19 and apprentice rate 2.65, +# set from 1 October 2012 by S.I. 2012/2397 reg. 2(2), (4)(a): +# https://www.legislation.gov.uk/uksi/2012/2397/made +# At the start of 2014 those rates were 6.31 and 2.68, set from +# 1 October 2013 by S.I. 2013/1975 reg. 2(2), (3)(c): +# https://www.legislation.gov.uk/uksi/2013/1975/made +- name: Case 14, a non-apprentice receives the adult minimum wage in 2013. + period: 2013 + input: + age: 22 + is_apprentice: false + output: + minimum_wage: 6.19 + minimum_wage_category: BETWEEN_21_22 + +- name: Case 15, an apprentice under 19 receives the apprentice rate after their first year in 2013. + period: 2013 + input: + age: 18 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + output: + minimum_wage: 2.65 + minimum_wage_category: APPRENTICE + +- name: Case 16, an adult first-year apprentice receives the apprentice rate in 2013. + period: 2013 + input: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: true + output: + minimum_wage: 2.65 + minimum_wage_category: APPRENTICE + +- name: Case 17, an adult apprentice after their first year receives the adult rate in 2013. + period: 2013 + input: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + output: + minimum_wage: 6.19 + minimum_wage_category: BETWEEN_21_22 + +- name: Case 18, a non-apprentice receives the adult minimum wage in 2014. + period: 2014 + input: + age: 22 + is_apprentice: false + output: + minimum_wage: 6.31 + minimum_wage_category: BETWEEN_21_22 + +- name: Case 19, an apprentice under 19 receives the apprentice rate after their first year in 2014. + period: 2014 + input: + age: 18 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + output: + minimum_wage: 2.68 + minimum_wage_category: APPRENTICE + +- name: Case 20, an adult first-year apprentice receives the apprentice rate in 2014. + period: 2014 + input: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: true + output: + minimum_wage: 2.68 + minimum_wage_category: APPRENTICE + +- name: Case 21, an adult apprentice after their first year receives the adult rate in 2014. + period: 2014 + input: + age: 22 + is_apprentice: true + is_in_first_year_of_apprenticeship: false + output: + minimum_wage: 6.31 + minimum_wage_category: BETWEEN_21_22 diff --git a/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage.yaml b/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage.yaml index 7afc59c16a..1978a297b6 100644 --- a/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage.yaml @@ -60,6 +60,7 @@ input: age: 21 is_apprentice: true + is_in_first_year_of_apprenticeship: true output: minimum_wage: 8 @@ -102,5 +103,6 @@ input: age: 19 is_apprentice: true + is_in_first_year_of_apprenticeship: true output: minimum_wage: 5.28 diff --git a/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage_category.yaml b/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage_category.yaml index 681ca0692a..c39376e3a6 100644 --- a/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage_category.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/income/minimum_wage_category.yaml @@ -3,6 +3,7 @@ absolute_error_margin: 0 input: is_apprentice: true + is_in_first_year_of_apprenticeship: true output: minimum_wage_category: APPRENTICE - name: Under 18 diff --git a/policyengine_uk/tests/test_minimum_wage_rates.py b/policyengine_uk/tests/test_minimum_wage_rates.py index da9659640a..9040b03574 100644 --- a/policyengine_uk/tests/test_minimum_wage_rates.py +++ b/policyengine_uk/tests/test_minimum_wage_rates.py @@ -23,8 +23,9 @@ the parameters used to get wrong: with no 1 April 2023 entry, 2023 read the April 2022 rates, for example £9.50 instead of the £10.42 national living wage. -The model reads ``is_apprentice`` as "the apprenticeship rate applies" -(2015 Regs reg. 5: an apprentice under 19 or in the first 12 months). Ages +The apprenticeship rate applies to an apprentice under 19 or in the first +12 months (2015 Regs reg. 5). The adult apprenticeship-rate fixture therefore +sets both ``is_apprentice`` and ``is_in_first_year_of_apprenticeship``. Ages under 16 are not checked: the Act does not cover workers of compulsory school age, and the model gives them the under-18 rate. @@ -258,10 +259,11 @@ def test_minimum_wage_variable_matches_statutory_instruments(): for age in ages } # The apprenticeship rate displaces the age rates (2015 Regs reg. 4A(2)). - # is_apprentice stands for "the apprenticeship rate applies" (reg. 5). + # At age 19, the first-12-month condition is needed (reg. 5). people["apprentice_19"] = { "age": {str(year): 19 for year in years}, "is_apprentice": {str(year): True for year in years}, + "is_in_first_year_of_apprenticeship": {str(year): True for year in years}, } names = list(people) sim = Simulation( diff --git a/policyengine_uk/variables/household/income/is_apprentice.py b/policyengine_uk/variables/household/income/is_apprentice.py index abf53d9851..adb02e0715 100644 --- a/policyengine_uk/variables/household/income/is_apprentice.py +++ b/policyengine_uk/variables/household/income/is_apprentice.py @@ -1,11 +1,15 @@ from policyengine_uk.model_api import * -import datetime -import numpy as np class is_apprentice(Variable): value_type = bool entity = Person label = "In an apprenticeship programme" + documentation = ( + "Whether this person is an apprentice. Employer National Insurance " + "relief uses this status at any apprenticeship year. For the apprentice " + "minimum wage at age 19 or over, also supply " + "is_in_first_year_of_apprenticeship." + ) definition_period = YEAR default_value = False diff --git a/policyengine_uk/variables/household/income/is_in_first_year_of_apprenticeship.py b/policyengine_uk/variables/household/income/is_in_first_year_of_apprenticeship.py new file mode 100644 index 0000000000..6c099c5a69 --- /dev/null +++ b/policyengine_uk/variables/household/income/is_in_first_year_of_apprenticeship.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class is_in_first_year_of_apprenticeship(Variable): + value_type = bool + entity = Person + label = "In the first 12 months of the current apprenticeship" + documentation = ( + "Whether this person is within the first 12 months of the current " + "apprenticeship employment, including employment with a previous " + "employer where statutory continuity is preserved. This is an annual " + "caller-supplied classification, not an academic year or an inferred " + "start date. It does not by itself establish apprentice status." + ) + definition_period = YEAR + default_value = False + reference = ( + "https://www.legislation.gov.uk/uksi/2015/621/regulation/5", + "https://www.gov.uk/hmrc-internal-manuals/national-minimum-wage-manual/nmwm05300", + ) diff --git a/policyengine_uk/variables/household/income/minimum_wage.py b/policyengine_uk/variables/household/income/minimum_wage.py index de56855a31..d050d4a2d0 100644 --- a/policyengine_uk/variables/household/income/minimum_wage.py +++ b/policyengine_uk/variables/household/income/minimum_wage.py @@ -1,6 +1,4 @@ from policyengine_uk.model_api import * -import datetime -import numpy as np class minimum_wage(Variable): @@ -9,13 +7,13 @@ class minimum_wage(Variable): label = "Minimum wage" definition_period = YEAR unit = GBP + reference = "https://www.legislation.gov.uk/uksi/2015/621/regulation/5" def formula(person, period, parameters): MW = parameters(period).gov.hmrc.minimum_wage - is_apprentice = person("is_apprentice", period) age = person("age", period) return where( - is_apprentice, + person("qualifies_for_apprentice_minimum_wage", period), MW.apprentice, MW.non_apprentice.calc(age), ) diff --git a/policyengine_uk/variables/household/income/minimum_wage_category.py b/policyengine_uk/variables/household/income/minimum_wage_category.py index 0051e53d6b..670026c7bd 100644 --- a/policyengine_uk/variables/household/income/minimum_wage_category.py +++ b/policyengine_uk/variables/household/income/minimum_wage_category.py @@ -1,6 +1,4 @@ from policyengine_uk.model_api import * -import datetime -import numpy as np class MinimumWageCategory(Enum): @@ -19,12 +17,13 @@ class minimum_wage_category(Variable): entity = Person label = "Minimum wage category" definition_period = YEAR + reference = "https://www.legislation.gov.uk/uksi/2015/621/regulation/5" def formula(person, period, parameters): age = person("age", period) return select( [ - person("is_apprentice", period), + person("qualifies_for_apprentice_minimum_wage", period), age < 18, (age >= 18) & (age <= 20), (age >= 21) & (age <= 22), diff --git a/policyengine_uk/variables/household/income/qualifies_for_apprentice_minimum_wage.py b/policyengine_uk/variables/household/income/qualifies_for_apprentice_minimum_wage.py new file mode 100644 index 0000000000..cbe3d2710b --- /dev/null +++ b/policyengine_uk/variables/household/income/qualifies_for_apprentice_minimum_wage.py @@ -0,0 +1,16 @@ +from policyengine_uk.model_api import * + + +class qualifies_for_apprentice_minimum_wage(Variable): + value_type = bool + entity = Person + label = "Qualifies for the apprentice minimum wage" + definition_period = YEAR + reference = "https://www.legislation.gov.uk/uksi/2015/621/regulation/5" + + def formula(person, period, parameters): + p = parameters(period).gov.hmrc.minimum_wage + return person("is_apprentice", period) & ( + (person("age", period) < p.apprentice_age_limit) + | person("is_in_first_year_of_apprenticeship", period) + )