Skip to content

Commit

Permalink
California CAPI (Cash Assistance Program for Immigrants)
Browse files Browse the repository at this point in the history
Fixes #5416
  • Loading branch information
PavelMakarchuk committed Dec 27, 2024
1 parent fee2f90 commit e3a1436
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
- name: Single blind parent with non eligible dependent child
period: 2024
input:
people:
person1:
age: 30
is_tax_unit_head: true
is_blind: true
person2:
age: 4
is_tax_unit_dependent: true
spm_units:
spm_unit:
members: [person1, person2]
households:
household:
members: [person1, person2]
state_code: CA
output:
ca_state_supplement_payment_standard: 8_448
# - name: Single blind parent with non eligible dependent child
# period: 2024
# input:
# people:
# person1:
# age: 30
# is_tax_unit_head: true
# is_blind: true
# person2:
# age: 4
# is_tax_unit_dependent: true
# spm_units:
# spm_unit:
# members: [person1, person2]
# households:
# household:
# members: [person1, person2]
# state_code: CA
# output:
# ca_state_supplement_payment_standard: 8_448

- name: Married household with one blind and one disabled person, with a disabled dependent child, no food preparation and spouse in out of home care
period: 2024-01
Expand Down Expand Up @@ -46,4 +46,4 @@
state_code: CA
living_arrangements_allow_for_food_preparation: true
output:
ca_state_supplement_payment_standard: 2_503
ca_state_supplement_payment_standard: 2_639
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ca_state_supplement_payment_standard(Variable):
unit = USD
definition_period = MONTH
defined_for = StateCode.CA
reference = "https://www.cdss.ca.gov/Portals/9/CAPI/CAPI_Regulations-Accessible.pdf"
reference = "https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=WIC&sectionNum=12200"

def formula(spm_unit, period, parameters):
p = parameters(
Expand All @@ -32,7 +32,7 @@ def formula(spm_unit, period, parameters):
is_disabled = person("is_disabled", period)
age = person("monthly_age", period)
is_aged = age >= p.aged_or_disabled.age_threshold
aged_or_disabled = is_aged | is_disabled
aged_or_disabled = (is_aged | is_disabled) * head_or_spouse
aged_disabled_count = spm_unit.sum(aged_or_disabled)
aged_disabled_amount = select(
[
Expand All @@ -49,16 +49,22 @@ def formula(spm_unit, period, parameters):
living_arrangements_allow_for_food_preparation = spm_unit.household(
"living_arrangements_allow_for_food_preparation", period
)
food_allowance_amount_eligible = (
~living_arrangements_allow_for_food_preparation & aged_or_disabled
)
food_allowance_amount_eligible_count = spm_unit.sum(
food_allowance_amount_eligible
food_allowance_amount = select(
[
(is_married == 1) & (aged_disabled_count == 2),
(is_married == 1) & (aged_disabled_count == 1),
(aged_disabled_count == 1),
],
[
p.allowance.food.married,
p.allowance.food.single,
p.allowance.food.single,
],
default=0,
)
food_allowance_amount = where(
is_married,
food_allowance_amount_eligible_count * p.allowance.food.married,
food_allowance_amount_eligible_count * p.allowance.food.single,
food_allowance_full_amount = (
living_arrangements_allow_for_food_preparation
* food_allowance_amount
)
# Dependent amount
dependent = person("is_tax_unit_dependent", period)
Expand Down Expand Up @@ -88,7 +94,7 @@ def formula(spm_unit, period, parameters):
# Total amount
return (
max_(blind_amount, aged_disabled_amount)
+ food_allowance_amount
+ food_allowance_full_amount
+ dependent_amount
+ medical_care_facility_amount
+ out_of_home_care_facility_amount
Expand Down

0 comments on commit e3a1436

Please sign in to comment.