Skip to content

Commit ff8196e

Browse files
committed
scottish benefit stuff
1 parent 00cd418 commit ff8196e

16 files changed

+125
-75
lines changed

Artifacts.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ lazy = true
1414
sha256 = "7ed1e796fc2e09a4c48f772ea3cd06b7c6aab721c183f6905b2fa83890d0184b"
1515
url = "http://stb-artifacts/disability.tar.gz"
1616

17+
[example_data]
18+
git-tree-sha1 = "cb37e530a22923314e5c8a7edc2a55b45783b7f9"
19+
lazy = true
20+
21+
[[example_data.download]]
22+
sha256 = "c7baac717d0acddae5189cbf0a44ba45b7e7b4074387c51a9446ac6c6ccca02e"
23+
url = "https://virtual-worlds.biz/artifacts//example_data.tar.gz"
24+
1725
[exampledata]
1826
git-tree-sha1 = "7853136d3530ea531e4f45a29f8fcef81d08fc1c"
1927
lazy = true

data/example_data/example_people-w-enums.tab

Lines changed: 19 additions & 19 deletions
Large diffs are not rendered by default.

docs/scottish-benefit-notes-2025.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ You’ll be able to apply from 24 March 2025 if you live in: [most areas]
5050
> You do not need to do anything to start the move to Pension Age Disability Payment.
5151
5252
## Carer Support Payment
53-
53+
https://www.mygov.scot/carer-support-payment
5454
maps to Carer's Allowance
5555

5656
> Some people’s benefits have already moved to Social Security Scotland. The process started in February 2024. It’ll take until spring 2025 to move everyone’s benefits across.
5757
5858
(not in FRS)
5959

60-
Carers_Allowance = 13
60+
Carers_Allowance = 13 => CARERS_SUPPORT_PAYMENT => carers_support_payment = 2029
6161

6262
## CHILD DLA FUCKUP
6363

@@ -104,3 +104,15 @@ mpers[(mpers.income_dlamobility.>0).&(mpers.income_personal_independence_payment
104104
27 cases in pooled UK dataset
105105

106106
```
107+
108+
## Carer's Allowance Supplement
109+
110+
https://www.mygov.scot/carers-allowance-supplement
111+
112+
SCOTTISH_CARERS_SUPPLEMENT => carers_allowance_supplement => SCOTTISH_CARERS_SUPPLEMENT
113+
114+
Carer's Allowance Supplement is an extra payment for people in Scotland who get Carer Support Payment or Carer's Allowance on a particular date.
115+
116+
Carer's Allowance Supplement is paid 2 times a year.
117+
118+
The Carer’s Allowance Supplement 2025 eligibility dates will be available soon.

scripts/income_enum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
STUDENT_LOANS = 92
9898
COUNCIL_TAX_BENEFIT = 93
9999
CONTRIB_EMPLOYMENT_AND_SUPPORT_ALLOWANCE = 94
100-
SCOTTISH_CARERS_SUPPLEMENT = 95
100+
CARERS_ALLOWANCE_SUPPLEMENT = 95
101101
SPARE_BEN_1 = 96
102102
SPARE_BEN_2 = 97
103103
SPARE_BEN_3 = 98

src/Definitions.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,9 @@ export wages,
11971197
adp_mobility,
11981198
pension_age_disability_daily_living,
11991199
pension_age_disability_care,
1200+
carers_allowance_supplement,
1201+
carers_support_payment,
1202+
discretionary_housing_payment,
12001203
other_benefits
12011204

12021205
@enum Incomes_Type begin
@@ -1294,9 +1297,11 @@ export wages,
12941297
pupil_development_grant = 2123
12951298
adp_daily_living = 2124
12961299
adp_mobility = 2125
1297-
pension_age_disability_daily_living = 2126
1298-
pension_age_disability_care = 2127
1299-
other_benefits = 3000
1300+
pension_age_disability = 2126
1301+
carers_allowance_supplement = 2028
1302+
carers_support_payment = 2029
1303+
discretionary_housing_payment = 2999
1304+
other_benefits = 3000
13001305
end
13011306

13021307
Incomes_Dict = Dict{Incomes_Type,T} where T<:Real
@@ -1869,6 +1874,7 @@ export DLAself_care,
18691874
Child_Disability_Payment_Care, # _Scotland_only,
18701875
Child_Disability_Payment_Mobility, # _Scotland_only,
18711876
Pension_Age_Disability,
1877+
Carers_Allowance_Supplement,
18721878
School_clothing_grant,
18731879
One_off_IRB_Payment
18741880

@@ -1951,6 +1957,8 @@ export Missing_Benefit_Type
19511957
Pupil_Development_Grant = 123
19521958
Disability_Topup = 125 # 2022 only so far
19531959
Pension_Topup = 126 # 2022 only so far
1960+
Carers_Allowance_Supplement = 999
1961+
Carers_Support_Payment = 997 # FIXME not yet in data - numbers wrong
19541962
Pension_Age_Disability = 998 # FIXME not yet in data - numbers wrong
19551963
end
19561964

src/ExampleHelpers.jl

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,39 @@ export SS_Examples, cpl_w_2_children_hh, single_parent_hh, single_hh, childless_
4848

4949
@enum SS_Examples cpl_w_2_children_hh single_parent_hh single_hh childless_couple_hh mbu
5050

51+
const EXAMPLES = Dict{SS_Examples, Household}()
52+
5153
"""
5254
5355
"""
54-
function get_ss_examples( settings = Settings() )::Dict{SS_Examples, Household}
55-
d = Dict{SS_Examples, Household}()
56+
function make_ss_examples( settings = Settings() )
5657
settings = Settings()
5758
settings.benefit_generosity_estimates_available = false
5859
settings.indirect_method = matching # force loading indirect tax stuff
5960
@time names = ExampleHouseholdGetter.initialise( settings )
60-
d[cpl_w_2_children_hh] = ExampleHouseholdGetter.get_household( "example_hh1" )
61-
d[single_parent_hh] = ExampleHouseholdGetter.get_household( "single_parent_1" )
62-
d[single_hh] = ExampleHouseholdGetter.get_household( "example_hh2" )
63-
d[childless_couple_hh] = ExampleHouseholdGetter.get_household("mel_c2_scot")
64-
d[mbu] = ExampleHouseholdGetter.get_household("mbu_example")
65-
return d
61+
EXAMPLES[cpl_w_2_children_hh] = ExampleHouseholdGetter.get_household( "example_hh1" )
62+
EXAMPLES[single_parent_hh] = ExampleHouseholdGetter.get_household( "single_parent_1" )
63+
EXAMPLES[single_hh] = ExampleHouseholdGetter.get_household( "example_hh2" )
64+
EXAMPLES[childless_couple_hh] = ExampleHouseholdGetter.get_household("mel_c2_scot")
65+
EXAMPLES[mbu] = ExampleHouseholdGetter.get_household("mbu_example")
6666
end
6767

68-
const EXAMPLES = get_ss_examples()
68+
69+
function get_ss_examples()::Dict{SS_Examples, Household}
70+
if length( EXAMPLES) == 0
71+
make_ss_examples()
72+
end
73+
return EXAMPLES
74+
end
6975

7076
function get_example( which :: SS_Examples ) :: Household
71-
return deepcopy(EXAMPLES[ which ])
77+
return deepcopy(get_ss_examples()[ which ])
7278
end
7379

7480
function get_all_examples()
75-
return deepcopy( EXAMPLES )
81+
return deepcopy(get_ss_examples())
7682
end
7783

78-
const SPARE_CHILD = get_example(cpl_w_2_children_hh).people[320190000104]
79-
const SPARE_ADULT = get_head( get_example(single_hh))
8084

8185
function unemploy!( pers::Person )
8286
pers.usual_hours_worked = 0
@@ -171,8 +175,9 @@ end
171175
Add a child to the 1st benefit unit
172176
"""
173177
function add_child!( hh :: Household, age :: Integer, sex :: Sex )::BigInt
174-
head = get_head(hh)
175-
np = deepcopy( SPARE_CHILD )
178+
head = get_head(hh)
179+
spare_child = get_example(cpl_w_2_children_hh).people[320190000104]
180+
np = deepcopy( spare_child )
176181
empty!( np.income )
177182
np.relationships[head.pid] = Son_or_daughter_incl_adopted
178183
# TODO fill in other relationships
@@ -199,7 +204,8 @@ end
199204
sex :: Sex ) :: BigInt
200205

201206
head = get_head(hh)
202-
np = deepcopy( SPARE_ADULT )
207+
spare_adult = get_head( get_example(single_hh))
208+
np = deepcopy( spare_adult )
203209
bus = get_benefit_units( hh )
204210
nbus = size(bus)[1]
205211
np.pid = maximum( keys( hh.people ))+1

src/ExampleHouseholdGetter.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ using .RunSettings
2121

2222
export initialise, get_household
2323

24-
EXAMPLE_HOUSEHOLDS = Dict{String,Household}()
24+
const EXAMPLE_HOUSEHOLDS = Dict{String,Household}()
2525

26-
KEYMAP = Vector{AbstractString}()
26+
const KEYMAP = Vector{AbstractString}()
2727

2828
function find_consumption_for_example!( hh, settings )
2929
@argcheck settings.indirect_method == matching
@@ -56,6 +56,7 @@ function find_wealth_for_example!( hh, settings )
5656
end
5757

5858

59+
5960
"""
6061
return number of households available
6162
"""
@@ -71,19 +72,13 @@ function initialise(
7172
# lazy load cons data if needs be
7273
tmp_data_source = settings.data_source
7374
settings.data_source = ExampleSource
74-
# tmpsource = settings.data_source # hack to work round datasource being wired in to settings
7575
if settings.indirect_method == matching
7676
ConsumptionData.init( settings )
7777
end
7878
if settings.wealth_method == matching
7979
WealthData.init( settings )
8080
end
8181
KEYMAP = Vector{AbstractString}()
82-
83-
# ds = example_datasets( settings )
84-
# hh_dataset = CSV.File( ds.hhlds, delim='\t' ) |> DataFrame
85-
# people_dataset = CSV.File(ds.people, delim='\t' ) |> DataFrame
86-
# @show ds
8782
hh_dataset = HouseholdFromFrame.read_hh(
8883
joinpath(artifact"exampledata","households.tab" ))# CSV.File( ds.hhlds ) |> DataFrame
8984
people_dataset =
@@ -117,12 +112,17 @@ function example_names()
117112
end
118113

119114
function get_household( pos :: Integer ) :: Household
115+
if length(EXAMPLE_HOUSEHOLDS) == 0
116+
initialise( Settings())
117+
end
120118
key = KEYMAP[pos]
121119
return EXAMPLE_HOUSEHOLDS[key]
122120
end
123121

124122
function get_household( name :: AbstractString ) :: Household
125-
# global EXAMPLE_HOUSEHOLDS
123+
if length(EXAMPLE_HOUSEHOLDS) == 0
124+
initialise( Settings())
125+
end
126126
return EXAMPLE_HOUSEHOLDS[name]
127127
end
128128

src/Incomes_New_Start.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ module STBIncomes
9494
CONTRIB_EMPLOYMENT_AND_SUPPORT_ALLOWANCE
9595

9696
SCOTTISH_CHILD_PAYMENT
97-
SCOTTISH_CARERS_SUPPLEMENT
97+
CARERS_ALLOWANCE_SUPPLEMENT
9898

99-
DISCRESIONARY_HOUSING_PAYMENT # not just Scottish, but, hey..
99+
DISCRETIONARY_HOUSING_PAYMENT # not just Scottish, but, hey..
100100
CHILD_DISABILITY_PAYMENT_CARE
101101
CHILD_DISABILITY_PAYMENT_MOBILITY
102102
PENSION_AGE_DISABILITY

src/NonMeansTestedBenefits.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ module NonMeansTestedBenefits
487487

488488
if hh.region == Scotland
489489
if pres.income[sys.carers.slot] > 0
490-
pres.income[SCOTTISH_CARERS_SUPPLEMENT] = sys.carers.scottish_supplement
490+
pres.income[CARERS_ALLOWANCE_SUPPLEMENT] = sys.carers.scottish_supplement
491491
end
492492
end
493493
# NON-overlapping rules p1178 go here

src/Results.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,15 @@ module Results
901901
out[GUARDIANS_ALLOWANCE] = incd[Definitions.guardians_allowance]
902902
end
903903

904+
out[SCOTTISH_CHILD_PAYMENT] = get(incd,Definitions.scottish_child_payment , 0.0 )
905+
out[CARERS_ALLOWANCE_SUPPLEMENT] = get( incd, Definitions. carers_allowance_supplement, 0.0 )
906+
out[DISCRETIONARY_HOUSING_PAYMENT] = get( incd, Definitions.discretionary_housing_payment, 0.0 )
907+
out[CARERS_SUPPORT_PAYMENT] = get( incd, Definitions.carers_support_payment, 0.0 )
908+
out[CHILD_DISABILITY_PAYMENT_CARE] = get( incd, Definitions.child_disability_payment_care, 0.0 )
909+
out[CHILD_DISABILITY_PAYMENT_MOBILITY] = get( incd, Definitions.child_disability_payment_mobility, 0.0 )
910+
out[PENSION_AGE_DISABILITY] = get( incd, Definitions.pension_age_disability, 0.0 )
911+
out[ADP_DAILY_LIVING] = get( incd, Definitions.adp_daily_living, 0.0 )
912+
out[ADP_MOBILITY] = get( incd, Definitions.adp_mobility, 0.0 )
904913
# FIXME 6/7/2023 add
905914
#=
906915
scottish_child_payment = 2112

0 commit comments

Comments
 (0)