diff --git a/changelog.d/co-ccap-activity-test.fixed.md b/changelog.d/co-ccap-activity-test.fixed.md new file mode 100644 index 00000000000..532c091288d --- /dev/null +++ b/changelog.d/co-ccap-activity-test.fixed.md @@ -0,0 +1 @@ +Require an eligible activity for Colorado child care assistance. Count reported basic education and technical training, include co-resident caretaker spouses when a parent link is missing, and evaluate monthly wage and business work separately. When only some eligible children meet the activity requirement, pay only for those children. diff --git a/policyengine_us/parameters/gov/states/co/ccap/activity/earned_income_sources.yaml b/policyengine_us/parameters/gov/states/co/ccap/activity/earned_income_sources.yaml new file mode 100644 index 00000000000..309e07c467c --- /dev/null +++ b/policyengine_us/parameters/gov/states/co/ccap/activity/earned_income_sources.yaml @@ -0,0 +1,19 @@ +description: Colorado counts these income sources as earnings from employment or self-employment under the Child Care Assistance Program activity requirement. +values: + 2020-01-01: + - employment_income + - self_employment_income + - sstb_self_employment_income + - farm_operations_income + +metadata: + unit: list + period: year + label: Colorado CCAP activity requirement earned income sources + reference: + - title: "8 CCR 1403-1 Section 3.111(G)(1) and (2), employment and self-employed criteria #page 36-37" + href: https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12658&fileName=8%20CCR%201403-1#page=36 + - title: 8 CCR 1403-1 Section 3.111(G)(1) and (2), December 2025 edition + href: https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=19 + - title: 9 CCR 2503-9 Section 3.905.1(G)(1) and (2), December 2019 edition + href: https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=8430&fileName=9%20CCR%202503-9#page=16 diff --git a/policyengine_us/parameters/gov/states/co/ccap/activity/substance_use_treatment.yaml b/policyengine_us/parameters/gov/states/co/ccap/activity/substance_use_treatment.yaml new file mode 100644 index 00000000000..34da423e5e3 --- /dev/null +++ b/policyengine_us/parameters/gov/states/co/ccap/activity/substance_use_treatment.yaml @@ -0,0 +1,10 @@ +description: Colorado counts qualifying substance use disorder treatment as a Child Care Assistance Program activity when this is true. +values: + 2015-01-01: false + 2026-07-01: true +metadata: + unit: bool + label: Colorado CCCAP substance use disorder treatment activity + reference: + - title: 8 CCR 1403-1 Section 3.111(G)(4)(a)(3) + href: https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=21 diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_activity_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_activity_eligible.yaml new file mode 100644 index 00000000000..de95ab0375a --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_activity_eligible.yaml @@ -0,0 +1,1204 @@ +# 8 CCR 1403-1 section 3.111(B)(1), (D), (E) and (G); 3.115(C); 3.116(A); 3.119(D); 3.121(B)(3). +# Federal minimum wage $7.25: 40 hours for 52 weeks is 2,080 hours, so the floor is $15,080. +- name: Case 1, single parent with wages and no recorded hours does not meet the requirement. + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 20_000 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + # Positive wages divided by zero recorded hours give no verified rate. + co_ccap_activity_eligible: false + +- name: Case 2, single parent with no activity does not meet the requirement. + period: 2026-01 + input: + people: + parent: + age: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 3, wages exactly at the minimum wage floor for the hours worked meet the requirement. + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 15_080 + weekly_hours_worked_before_lsr: 40 + weeks_worked: 52 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 4, wages a dollar below the floor fail 3.111(G)(1)(b). + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 15_079 + weekly_hours_worked_before_lsr: 40 + weeks_worked: 52 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 5, 26 weeks of earnings alone do not establish work in January. + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 10_000 + weekly_hours_worked_before_lsr: 40 + weeks_worked: 26 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + # 40 x 26 = 1,040 hours x $7.25 = $7,540 <= $10,000 + # $10,000 / (26 × 40) is $9.62 per hour, with no evidence of January work. + co_ccap_activity_eligible: false + +- name: Case 6, with no weeks reported, usual hours run the full year, so the same $10,000 fails. + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 10_000 + weekly_hours_worked_before_lsr: 40 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 7, self-employment income above the floor meets 3.111(G)(2). + period: 2026-01 + input: + people: + parent: + age: 30 + self_employment_income: 20_000 + weekly_hours_worked_before_lsr: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + # 30 x 52 = 1,560 hours x $7.25 = $11,310 <= $20,000 + co_ccap_activity_eligible: true + +- name: Case 8, a business loss fails 3.111(G)(2)(c). + period: 2026-01 + input: + people: + parent: + age: 30 + self_employment_income: -5_000 + weekly_hours_worked_before_lsr: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 9, a business loss does not erase wages. + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 20_000 + self_employment_income: -30_000 + weekly_hours_worked_before_lsr: 40 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 10, a full-time college student meets 3.111(G)(4)(a)(1), which the model takes to be a first bachelor's degree or less. + period: 2026-01 + input: + people: + parent: + age: 30 + is_full_time_college_student: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 11, two parents who both work meet 3.111(D)(1)(c)(1). + period: 2026-01 + input: + people: + parent1: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + parent2: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + child: + age: 3 + spm_units: + spm_unit: + members: [parent1, parent2, child] + tax_units: + tax_unit: + members: [parent1, parent2, child] + households: + household: + members: [parent1, parent2, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 12, one parent working and the other at home and able to provide care fail 3.111(D)(1)(c). + period: 2026-01 + input: + people: + parent1: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + parent2: + age: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent1, parent2, child] + tax_units: + tax_unit: + members: [parent1, parent2, child] + households: + household: + members: [parent1, parent2, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 13, one parent working and the other incapacitated meet 3.111(D)(1)(c)(3). + period: 2026-01 + input: + people: + parent1: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + parent2: + age: 30 + is_disabled: true + co_ccap_incapacitated: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent1, parent2, child] + tax_units: + tax_unit: + members: [parent1, parent2, child] + households: + household: + members: [parent1, parent2, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 14, an incapacitated single parent with no activity fails 3.111(E). + period: 2026-01 + input: + people: + parent: + age: 30 + is_disabled: true + co_ccap_incapacitated: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 15, two incapacitated parents with no activity fail, since neither is in an activity. + period: 2026-01 + input: + people: + parent1: + age: 30 + is_disabled: true + co_ccap_incapacitated: true + parent2: + age: 30 + is_disabled: true + co_ccap_incapacitated: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent1, parent2, child] + tax_units: + tax_unit: + members: [parent1, parent2, child] + households: + household: + members: [parent1, parent2, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 16, an incarcerated parent counts as absent under 3.111(D)(1)(b), so the working parent qualifies. + period: 2026-01 + input: + people: + parent1: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + parent2: + age: 30 + is_incarcerated: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent1, parent2, child] + tax_units: + tax_unit: + members: [parent1, parent2, child] + households: + household: + members: [parent1, parent2, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 17, a retired grandparent who files separately is not a caretaker under 3.103(C). + period: 2026-01 + input: + people: + grandparent: + age: 70 + parent: + age: 30 + employment_income: 20_000 + weekly_hours_worked_before_lsr: 40 + child: + age: 3 + spm_units: + spm_unit: + members: [grandparent, parent, child] + tax_units: + grandparent_tax_unit: + members: [grandparent] + parent_tax_unit: + members: [parent, child] + households: + household: + members: [grandparent, parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 18, a working grandparent who files separately does not supply the claiming parent's activity. + period: 2026-01 + input: + people: + grandparent: + age: 60 + employment_income: 50_000 + weekly_hours_worked_before_lsr: 40 + parent: + age: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [grandparent, parent, child] + tax_units: + grandparent_tax_unit: + members: [grandparent] + parent_tax_unit: + members: [parent, child] + households: + household: + members: [grandparent, parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 19, the activity input covers job search and other activities the model does not track. + period: 2026-01 + input: + people: + parent: + age: 30 + co_ccap_other_activity: JOB_SEARCH + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 20, TANF receipt alone does not meet the requirement, since 3.115(C) holds caretakers of children on basic cash assistance to the low-income test. + period: 2026-01 + input: + people: + parent: + age: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + is_tanf_enrolled: true + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 21, an at-home referral alone gives no activity waiver. + period: 2026-01 + input: + people: + caretaker: + age: 50 + child: + age: 3 + receives_or_needs_protective_services: true + spm_units: + spm_unit: + members: [caretaker, child] + tax_units: + tax_unit: + members: [caretaker, child] + households: + household: + members: [caretaker, child] + state_code: CO + output: + # Zero active caretakers and zero qualifying placements or authorizations. + co_ccap_activity_eligible: false + +- name: Case 22, an eligible child in foster care exempts the household under 3.118(A) and 3.119(D). + period: 2026-01 + input: + people: + caretaker: + age: 50 + child: + age: 3 + is_in_foster_care: true + co_ccap_child_welfare_activity_waiver: true + spm_units: + spm_unit: + members: [caretaker, child] + tax_units: + tax_unit: + members: [caretaker, child] + households: + household: + members: [caretaker, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 23, homelessness outside an authorized stabilization period gives no activity waiver. + period: 2026-01 + input: + people: + parent: + age: 30 + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + is_homeless: true + output: + # Zero active caretakers and zero authorized stabilization months. + co_ccap_activity_eligible: false + +- name: Case 24, a working parent with an eligible child receives the subsidy through the full pipeline. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 30 + employment_income: 30_000 + weekly_hours_worked_before_lsr: 40 + child: + age: 3 + childcare_hours_per_day: 8 + spm_units: + spm_unit: + members: [parent, child] + spm_unit_pre_subsidy_childcare_expenses: 12_000 + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + county: DENVER_COUNTY_CO + output: + co_ccap_activity_eligible: true + co_ccap_eligible: true + # $1,000 a month less the $128 parent fee in court_supervision.yaml Case 5. + co_ccap_subsidy: 872 + +- name: Case 25, the same family with the same income from a pension receives nothing. + period: 2026-01 + input: + people: + parent: + age: 30 + pension_income: 30_000 + child: + age: 3 + childcare_hours_per_day: 8 + spm_units: + spm_unit: + members: [parent, child] + spm_unit_pre_subsidy_childcare_expenses: 12_000 + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + county: DENVER_COUNTY_CO + output: + co_ccap_activity_eligible: false + co_ccap_eligible: false + co_ccap_subsidy: 0 + +- name: Case 26, a graduate student is not in a first bachelor's degree program, so the student fails 3.111(G)(4)(a)(1). + period: 2026-01 + input: + people: + parent: + age: 30 + is_full_time_college_student: true + co_ccap_in_eligible_education: false + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 27, a part-time college student meets 3.111(G)(4)(a)(1), which sets no full-time requirement. + period: 2026-01 + input: + people: + parent: + age: 30 + is_part_time_college_student: true + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 28, a Colorado Works participant in allowable work activities meets 3.116(A) through the activity input. + period: 2026-01 + input: + people: + parent: + age: 30 + co_ccap_other_activity: COLORADO_WORKS + child: + age: 3 + spm_units: + spm_unit: + members: [parent, child] + is_tanf_enrolled: true + tax_units: + tax_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 29, a father whom the child's parent ids name counts as a caretaker under 3.111(D)(2) though he files separately, so his lack of activity blocks the working mother. + period: 2026-01 + input: + people: + mother: + person_id: 1 + age: 30 + employment_income: 30_000 + weekly_hours_worked_before_lsr: 40 + father: + person_id: 2 + age: 30 + child: + person_id: 3 + age: 3 + parent_1_id: 1 + parent_2_id: 2 + spm_units: + spm_unit: + members: [mother, father, child] + tax_units: + mother_tax_unit: + members: [mother, child] + father_tax_unit: + members: [father] + households: + household: + members: [mother, father, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Case 30, the same father working supplies the activity beside an incapacitated mother under 3.111(D)(1)(c)(3). + period: 2026-01 + input: + people: + mother: + person_id: 1 + age: 30 + is_disabled: true + co_ccap_incapacitated: true + father: + person_id: 2 + age: 30 + employment_income: 30_000 + weekly_hours_worked_before_lsr: 40 + child: + person_id: 3 + age: 3 + parent_1_id: 1 + parent_2_id: 2 + spm_units: + spm_unit: + members: [mother, father, child] + tax_units: + mother_tax_unit: + members: [mother, child] + father_tax_unit: + members: [father] + households: + household: + members: [mother, father, child] + state_code: CO + output: + co_ccap_activity_eligible: true + +- name: Case 31, a working grandparent whom the mother's parent ids name is still not the child's caretaker, so the inactive mother fails. + period: 2026-01 + input: + people: + grandparent: + person_id: 1 + age: 60 + employment_income: 50_000 + weekly_hours_worked_before_lsr: 40 + mother: + person_id: 2 + age: 30 + parent_1_id: 1 + child: + person_id: 3 + age: 3 + parent_1_id: 2 + spm_units: + spm_unit: + members: [grandparent, mother, child] + tax_units: + grandparent_tax_unit: + members: [grandparent] + mother_tax_unit: + members: [mother, child] + households: + household: + members: [grandparent, mother, child] + state_code: CO + output: + co_ccap_activity_eligible: false + +- name: Separate service-business earnings meet the wage floor + period: 2026-01 + input: + people: + parent: {age: 30, sstb_self_employment_income: 15080, weekly_hours_worked_before_lsr: 40, weeks_worked: 52} + child: &activity_child {age: 3, childcare_hours_per_day: 8} + spm_units: &activity_single {family: {members: [parent, child]}} + tax_units: *activity_single + households: &activity_home {home: {members: [parent, child], state_code: CO}} + # $15,080 / (40 × 52) = $7.25 per hour. + output: {co_ccap_activity_eligible: true} + +- name: Net active farm earnings meet the wage floor + period: 2026-01 + input: + people: + parent: {age: 30, farm_operations_income: 15080, weekly_hours_worked_before_lsr: 40, weeks_worked: 52} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # $15,080 / (40 × 52) = $7.25 per hour. + output: {co_ccap_activity_eligible: true} + +- name: Fifty-two-week cap on an out-of-range weeks input + period: 2026-01 + input: + people: + parent: {age: 30, employment_income: 16000, weekly_hours_worked_before_lsr: 40, weeks_worked: 60} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # $7.25 × 40 × 52 = $15,080, below $16,000. + output: {co_ccap_activity_eligible: true} + +- name: A caretaker unable to care for themself alongside a working caretaker + period: 2026-01 + input: + people: + parent: &activity_worker {age: 35, employment_income: 30000, weekly_hours_worked_before_lsr: 40, weeks_worked: 52} + other: {age: 34, is_incapable_of_self_care: true} + child: *activity_child + spm_units: &activity_three {family: {members: [parent, other, child]}} + tax_units: *activity_three + households: &activity_three_home {home: {members: [parent, other, child], state_code: CO}} + # $30,000 > $15,080. One active and one presumed incapacitated. + output: {co_ccap_activity_eligible: true} + +- name: Child welfare waiver for an age-ineligible sibling does not waive the activity test + period: 2026-01 + input: + people: + parent: {age: 35} + other: {age: 15, co_ccap_child_welfare_activity_waiver: true} + child: *activity_child + spm_units: *activity_three + tax_units: *activity_three + households: *activity_three_home + # Age 15 exceeds the ordinary limit. Zero eligible children have a waiver. + output: {co_ccap_activity_eligible: false} + +- name: Two working parents qualify only in the child's SPM unit + period: 2026-01 + input: + people: + parent: {<<: *activity_worker, person_id: 1} + other: {<<: *activity_worker, person_id: 2} + child: &activity_linked_child {<<: *activity_child, person_id: 3, parent_1_id: 1, parent_2_id: 2} + spm_units: &activity_split {family: {members: [parent, child]}, apart: {members: [other]}} + tax_units: *activity_split + households: *activity_three_home + # Both earn $30,000 > $15,080. Only family contains the eligible child. + output: {co_ccap_activity_eligible: [true, false]} + +- name: Inactive co-resident father blocks eligibility across SPM units + period: 2026-01 + input: + people: + parent: {<<: *activity_worker, person_id: 1} + other: {age: 34, person_id: 2} + child: *activity_linked_child + spm_units: *activity_split + tax_units: *activity_split + households: *activity_three_home + # One of the two linked caretakers has neither an activity nor incapacity. + output: {co_ccap_activity_eligible: [false, false]} + +- name: Noncaretaking grandmother claims a linked teen parent and the teen's baby + period: 2026-01 + input: + people: + parent: {age: 17, person_id: 1, is_in_secondary_school: true} + other: {age: 60, person_id: 2} + child: {<<: *activity_child, person_id: 3, parent_1_id: 1} + spm_units: *activity_three + tax_units: *activity_three + households: *activity_three_home + # One linked caretaker, one basic education activity. + output: {co_ccap_activity_eligible: true} + +- name: Sole enrolled teen in the baby's tax unit qualifies without parent links + period: 2026-01 + input: + people: + parent: {age: 17, is_in_secondary_school: true} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # No adult filers. The only older member is the caretaker and is enrolled. + output: {co_ccap_activity_eligible: true} + +- name: Linked 17-year-old explicitly reported as unenrolled fails + period: 2026-01 + input: + people: + parent: {age: 17, person_id: 1, is_in_secondary_school: false} + child: {<<: *activity_child, person_id: 3, parent_1_id: 1} + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # The linked caretaker has no reported school or other activity. + output: {co_ccap_activity_eligible: false} + +- name: Denver high school parent receives the full subsidy + period: 2026-01 + input: + people: + parent: {age: 19, is_in_secondary_school: true} + child: *activity_child + spm_units: &activity_denver_expenses + family: {members: [parent, child], spm_unit_pre_subsidy_childcare_expenses: 12000} + tax_units: *activity_single + households: &activity_denver {home: {members: [parent, child], state_code: CO, county: DENVER_COUNTY_CO}} + # One qualifying student. $12,000 / 12 − $0 fee = $1,000. + output: {co_ccap_activity_eligible: true, co_ccap_eligible: true, co_ccap_subsidy: 1000} + +- name: A job that begins in July does not qualify in January + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: 10000 + weekly_hours_worked_before_lsr: 40 + weeks_worked: 26 + co_ccap_work_hours: {"2026-01": 0, "2026-07": 160} + co_ccap_work_wages: {"2026-07": 1600} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # No January hours. July wages of $1,600 / 160 hours meet the $7.25 floor. + output: + co_ccap_activity_eligible: {"2026-01": false, "2026-07": true} + +- name: Approved job search preserves January care and stops after the authorized months + period: 2026-01 + input: + people: + parent: + age: 30 + employment_income: {2025: 20000, 2026: 0} + weekly_hours_worked_before_lsr: {2025: 40, 2026: 0} + co_ccap_other_activity: {"2026-01": JOB_SEARCH, "2026-02": JOB_SEARCH, "2026-03": JOB_SEARCH, "2026-04": JOB_SEARCH} + child: *activity_child + spm_units: + family: + members: [parent, child] + spm_unit_pre_subsidy_childcare_expenses: 12000 + co_ccap_is_in_entry_process: {"2026-01": false} + co_ccap_is_in_re_determination_process: {"2026-01": true} + tax_units: *activity_single + households: *activity_denver + # The December job met $20,000 / 2,080 > $7.25. January job search is + # authorized after job loss. $12,000 / 12 − $0 fee = $1,000. + output: + co_ccap_activity_eligible: {"2026-01": true, "2026-05": false} + co_ccap_eligible: {"2026-01": true, "2026-05": false} + co_ccap_subsidy: {"2026-01": 1000, "2026-05": 0} + +- name: A qualifying wage job is evaluated apart from a loss-making business + period: 2026-01 + input: + people: + parent: + <<: *activity_worker + employment_income: 7800 + self_employment_income: -1000 + co_ccap_work_hours: 40 + co_ccap_work_wages: 600 + co_ccap_business_hours: 120 + co_ccap_business_profit: -80 + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # January wages: $600 / 40 hours = $15 per hour. + # The 120 January hours in the separate loss-making business do not count. + output: {co_ccap_activity_eligible: true} + +- name: Self-employment uses CCCAP profit after verified allowable expenses + period: 2026-01 + input: + people: + parent: + age: 30 + self_employment_income: 12000 + weekly_hours_worked_before_lsr: 40 + weeks_worked: 52 + co_ccap_business_hours: 160 + co_ccap_business_profit: 1500 + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # The verified CCCAP profit is separate from the $12,000 annual tax profit. + # January CCCAP profit: $1,500 / 160 hours = $9.375, above $7.25. + output: {co_ccap_activity_eligible: true} + +- name: One dollar of earnings with no recorded hours fails the wage test + period: 2026-01 + input: + people: + parent: {age: 30, employment_income: 1} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # $1 ÷ zero recorded hours does not establish an hourly rate. + output: {co_ccap_activity_eligible: false} + +- name: Foster placement without an open case gives no activity waiver + period: 2026-01 + input: + people: + parent: {age: 30} + child: {<<: *activity_child, is_in_foster_care: true} + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # Zero qualifying protective-services placements with open cases. + output: {co_ccap_activity_eligible: false} + +- name: Homelessness waives activity only during authorized stabilization + period: 2026-01 + input: + people: + parent: {age: 30} + child: *activity_child + spm_units: + family: + members: [parent, child] + co_ccap_homelessness_stabilization: {"2026-01": true} + tax_units: *activity_single + households: + home: {members: [parent, child], state_code: CO, is_homeless: {2026: true}} + # One authorized month passes. September has zero authorized time. + output: + co_ccap_activity_eligible: {"2026-01": true, "2026-09": false} + +- name: Disability alone does not excuse an inactive caretaker + period: 2026-01 + input: + people: + parent: *activity_worker + other: {age: 34, is_disabled: true} + child: *activity_child + spm_units: *activity_three + tax_units: *activity_three + households: *activity_three_home + # One of two caretakers works. The other can provide care. + output: {co_ccap_activity_eligible: false} + +- name: College ceases to qualify when all county-approved weeks are used + period: 2026-01 + input: + people: + parent: + age: 30 + is_full_time_college_student: true + co_ccap_education_weeks_remaining: {"2026-01": 1, "2026-02": 0} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # The remaining approved weeks fall from 1 to 0. + output: + co_ccap_activity_eligible: {"2026-01": true, "2026-02": false} + +- name: Colorado Works approval in one month does not continue all year + period: 2026-01 + input: + people: + parent: {age: 30, co_ccap_other_activity: {"2026-01": COLORADO_WORKS}} + child: *activity_child + spm_units: + family: {members: [parent, child], meets_ccdf_activity_test: {2026: true}} + tax_units: *activity_single + households: *activity_home + # There is one approved activity in January and zero in September. + output: + co_ccap_activity_eligible: {"2026-01": true, "2026-09": false} + +- name: Qualifying substance use treatment starts counting in July 2026 + period: 2026-01 + input: + people: + parent: {age: 30, co_ccap_other_activity: {"2026-06": SUBSTANCE_USE_TREATMENT, "2026-07": SUBSTANCE_USE_TREATMENT}} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # June precedes July 1. In July one qualifying treatment activity counts. + output: + co_ccap_activity_eligible: {"2026-06": false, "2026-07": true} + +- name: Denver teen parent with reported K-12 enrollment receives care + period: 2026-01 + input: + people: + parent: {age: 17, person_id: 1, is_in_k12_school: true} + child: &activity_one_parent_child {<<: *activity_child, person_id: 2, parent_1_id: 1} + spm_units: *activity_denver_expenses + tax_units: *activity_single + households: *activity_denver + # One enrolled caretaker. $12,000 / 12 - $0 fee = $1,000. + output: + co_ccap_in_eligible_education: {2026: [true, false]} + co_ccap_activity_eligible: true + co_ccap_eligible: true + co_ccap_subsidy: 1000 + +- name: Denver parent with reported full-time enrollment receives care + period: 2026-01 + input: + people: + parent: {age: 30, person_id: 1, is_full_time_student: true} + child: *activity_one_parent_child + spm_units: *activity_denver_expenses + tax_units: *activity_single + households: *activity_denver + # One enrolled caretaker. $12,000 / 12 - $0 fee = $1,000. + output: + co_ccap_in_eligible_education: {2026: [true, false]} + co_ccap_activity_eligible: true + co_ccap_eligible: true + co_ccap_subsidy: 1000 + +- name: The inactive stepfather counts alongside the linked mother + period: 2026-01 + input: + people: + parent: {age: 30, person_id: 1, tax_unit_role_input: HEAD, is_full_time_college_student: true} + other: {age: 32, person_id: 2, tax_unit_role_input: SPOUSE} + child: {<<: *activity_child, person_id: 3, tax_unit_role_input: DEPENDENT, parent_1_id: 1} + spm_units: + family: {members: [parent, other, child], spm_unit_pre_subsidy_childcare_expenses: 12000} + tax_units: *activity_three + households: *activity_three_home + # Both share custody and support the child. Only 1 of 2 caretakers qualifies. + output: {co_ccap_activity_eligible: false, co_ccap_eligible: false, co_ccap_subsidy: 0} + +- name: Zero business hours leave ongoing wage work eligible + period: 2026-01 + input: + people: + parent: {<<: *activity_worker, co_ccap_business_hours: 0} + child: *activity_child + spm_units: *activity_denver_expenses + tax_units: *activity_single + households: *activity_denver + # $30,000 / (40 × 52) > $7.25. $12,000 / 12 - $128 fee = $872. + output: {co_ccap_activity_eligible: true, co_ccap_eligible: true, co_ccap_subsidy: 872} + +- name: Zero wage hours leave ongoing business work eligible + period: 2026-01 + input: + people: + parent: {age: 30, self_employment_income: 15080, weekly_hours_worked_before_lsr: 40, weeks_worked: 52, co_ccap_work_hours: 0} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # The business earns $15,080 / (40 × 52) = $7.25 per hour. + output: {co_ccap_activity_eligible: true} + +- name: A verified wage month takes precedence over annual wage earnings + period: 2026-01 + input: + people: + parent: {<<: *activity_worker, co_ccap_work_hours: 0} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # Zero wage hours in January and $0 in business earnings give no qualifying work. + output: {co_ccap_activity_eligible: false} + +- name: A protected break counts only in the reported month + period: 2026-01 + input: + people: + parent: {age: 30, co_ccap_other_activity: {"2026-01": PROTECTED_BREAK}} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # One covered activity in January and zero in February. + output: {co_ccap_activity_eligible: {"2026-01": true, "2026-02": false}} + +- name: A business launch counts only in the approved month + period: 2026-01 + input: + people: + parent: {age: 30, co_ccap_other_activity: {"2026-01": BUSINESS_LAUNCH}} + child: *activity_child + spm_units: *activity_single + tax_units: *activity_single + households: *activity_home + # One approved activity in January and zero in February. + output: {co_ccap_activity_eligible: {"2026-01": true, "2026-02": false}} diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_eligible.yaml index 9d62bb51f3f..cde27d747c1 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_eligible.yaml @@ -7,6 +7,8 @@ co_ccap_is_in_re_determination_process: false co_ccap_re_determination_eligible: 2023-01: true + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -21,6 +23,8 @@ co_ccap_is_in_re_determination_process: false co_ccap_re_determination_eligible: 2023-01: true + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -35,6 +39,8 @@ co_ccap_is_in_re_determination_process: false co_ccap_re_determination_eligible: 2023-01: true + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -49,6 +55,8 @@ co_ccap_is_in_re_determination_process: true co_ccap_re_determination_eligible: 2023-01: true + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -63,6 +71,8 @@ co_ccap_is_in_re_determination_process: true co_ccap_re_determination_eligible: 2023-01: false + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -77,6 +87,8 @@ co_ccap_is_in_re_determination_process: true co_ccap_re_determination_eligible: 2023-01: false + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -91,6 +103,8 @@ co_ccap_is_in_re_determination_process: false co_ccap_re_determination_eligible: 2023-01: false + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: @@ -105,7 +119,41 @@ co_ccap_is_in_re_determination_process: true co_ccap_re_determination_eligible: 2023-01: false + co_ccap_activity_eligible: + 2023-01: true state_code: CO output: co_ccap_eligible: 2023-01: false + +- name: Eligible at entry with no activity, then ineligible for cccap + period: 2023 + input: + co_ccap_is_in_entry_process: true + co_ccap_entry_eligible: + 2023-01: true + co_ccap_is_in_re_determination_process: false + co_ccap_re_determination_eligible: + 2023-01: false + co_ccap_activity_eligible: + 2023-01: false + state_code: CO + output: + co_ccap_eligible: + 2023-01: false + +- name: Eligible at re-determination with no activity, then ineligible for cccap + period: 2023 + input: + co_ccap_is_in_entry_process: false + co_ccap_entry_eligible: + 2023-01: false + co_ccap_is_in_re_determination_process: true + co_ccap_re_determination_eligible: + 2023-01: true + co_ccap_activity_eligible: + 2023-01: false + state_code: CO + output: + co_ccap_eligible: + 2023-01: false diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_in_eligible_education.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_in_eligible_education.yaml new file mode 100644 index 00000000000..40713bdf8c7 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_in_eligible_education.yaml @@ -0,0 +1,69 @@ +# 8 CCR 1403-1 section 3.111(G)(4): training, post-secondary education for a first +# bachelor's degree or less, and basic education. +- name: Case 1, a full-time college student counts. + period: 2026 + input: + is_full_time_college_student: true + age: 30 + state_code: CO + output: + co_ccap_in_eligible_education: true + +- name: Case 2, a part-time college student counts, since 3.111(G)(4)(a)(1) sets no full-time requirement. + period: 2026 + input: + is_part_time_college_student: true + age: 30 + state_code: CO + output: + co_ccap_in_eligible_education: true + +- name: Case 3, a teen parent in high school counts as in basic education under 3.111(G)(4)(b). + period: 2026 + input: + age: 17 + is_in_secondary_school: true + state_code: CO + output: + co_ccap_in_eligible_education: true + +- name: Case 4, an adult who is not enrolled does not count. + period: 2026 + input: + age: 30 + state_code: CO + output: + co_ccap_in_eligible_education: false + +- name: Case 5, the variable applies only in Colorado. + period: 2026 + input: + is_full_time_college_student: true + age: 30 + state_code: NM + output: + co_ccap_in_eligible_education: false + +- name: A 19-year-old enrolled in high school is in basic education + period: 2026 + input: {age: 19, is_in_secondary_school: true, state_code: CO} + # One qualifying basic education program. + output: {co_ccap_in_eligible_education: true} + +- name: An adult in high-school equivalency is in basic education + period: 2026 + input: {age: 30, is_in_secondary_school: true, state_code: CO} + # One qualifying basic education program. + output: {co_ccap_in_eligible_education: true} + +- name: Technical training for a certificate qualifies + period: 2026 + input: {age: 30, technical_institution_student: true, state_code: CO} + # One qualifying technical program. + output: {co_ccap_in_eligible_education: true} + +- name: Age 17 alone supplies no evidence of enrollment + period: 2026 + input: {age: 17, is_in_secondary_school: false, state_code: CO} + # Zero reported education activities. + output: {co_ccap_in_eligible_education: false} diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_subsidy.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_subsidy.yaml index ff9daf2d40f..23ac27b5ffa 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_subsidy.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/co_ccap_subsidy.yaml @@ -19,3 +19,25 @@ output: co_ccap_subsidy: 2022-12: 1_400 + +- name: A qualifying caretaker releases only their child's care charges + period: 2026-01 + input: + people: + parent: {age: 30, person_id: 1, is_full_time_college_student: true} + child: {age: 3, person_id: 2, parent_1_id: 1, pre_subsidy_childcare_expenses: 4800} + other: {age: 30, person_id: 3} + other_child: {age: 3, person_id: 4, parent_1_id: 3, pre_subsidy_childcare_expenses: 7200} + tax_units: + family: {members: [parent, child]} + other_family: {members: [other, other_child]} + spm_units: {family: {members: [parent, child, other, other_child]}} + households: {home: {members: [parent, child, other, other_child], state_code: CO, county: DENVER_COUNTY_CO}} + # Both children pass the age and dependency screen. Only the first child's + # caretaker qualifies, so pay $4,800 / 12 - $0 = $400 of the $1,000 bill. + output: + co_ccap_child_eligible: [false, true, false, true] + co_ccap_activity_eligible: true + co_ccap_parent_fee: 0 + co_ccap_eligible: true + co_ccap_subsidy: 400 diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/court_supervision.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/court_supervision.yaml index 1ce3460e0af..3f0b2dbbf17 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/ccap/court_supervision.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ccap/court_supervision.yaml @@ -58,6 +58,7 @@ person1: age: 40 employment_income: 30_000 + weekly_hours_worked_before_lsr: 40 person2: age: 15 is_disabled: false @@ -112,6 +113,7 @@ person1: age: 40 employment_income: 30_000 + weekly_hours_worked_before_lsr: 40 person2: age: 15 is_disabled: false diff --git a/policyengine_us/tests/test_co_ccap_activity_properties.py b/policyengine_us/tests/test_co_ccap_activity_properties.py new file mode 100644 index 00000000000..eea02e34c8d --- /dev/null +++ b/policyengine_us/tests/test_co_ccap_activity_properties.py @@ -0,0 +1,298 @@ +"""Invariants of Colorado's child care activity requirement. + +8 CCR 1403-1 section 3.111(B)(1) requires caretakers to take part in an eligible +activity, and (D) and (E) say which households qualify. + +1. Work with annual inputs requires recorded hours for ongoing work and earnings + at or above the federal minimum wage (3.111(G)(1)(b) and (G)(2)(d)). + Reported college, secondary school and technical enrollment can qualify + (3.111(G)(4)). Without the exempt paths, + a household qualifies when a caretaker is in an activity and every other + caretaker is in an activity or incapacitated (3.111(D)(1)(c), 3.111(E)). +2. No family without the requirement receives a subsidy: co_ccap_eligible implies + co_ccap_activity_eligible, and co_ccap_subsidy is zero without it. +3. Raising a caretaker's earnings never removes eligibility while hours stay the + same. +4. An adult who files separately, claims no eligible child and isn't named by the + child's parent ids doesn't change the answer, whatever that adult earns. +5. When the child's parent ids name both parents, tax filing doesn't change the + answer (3.111(D)(2)). +6. Child welfare and stabilization waivers and other approved monthly activities + qualify a family (3.119(D), 3.121(B)(3)(a)). TANF receipt alone doesn't + (3.111(D)(6), 3.115(C)). + +The YAML cases pin single families. These generate earnings, hours, weeks and +family makeups, which YAML can't express. +""" + +import pytest +from hypothesis import example, given, settings +from hypothesis import strategies as st + +from policyengine_us import Simulation + +YEAR = 2026 +MONTH = "2026-01" +MINIMUM_WAGE = 7.25 +WEEKS_IN_YEAR = 52 + +caretakers = st.fixed_dictionaries( + { + "wages": st.integers(min_value=0, max_value=60_000), + "business": st.integers(min_value=-30_000, max_value=60_000), + "hours": st.integers(min_value=0, max_value=70), + "weeks": st.integers(min_value=0, max_value=52), + "student": st.booleans(), + "part_time": st.booleans(), + "secondary": st.booleans(), + "technical": st.booleans(), + "incapacitated": st.booleans(), + } +) + + +def person_input(caretaker): + return { + "age": {YEAR: 30}, + "employment_income": {YEAR: caretaker["wages"]}, + "self_employment_income": {YEAR: caretaker["business"]}, + "weekly_hours_worked_before_lsr": {YEAR: caretaker["hours"]}, + "weeks_worked": {YEAR: caretaker["weeks"]}, + "is_full_time_college_student": {YEAR: caretaker["student"]}, + "is_part_time_college_student": {YEAR: caretaker.get("part_time", False)}, + "is_in_secondary_school": {YEAR: caretaker.get("secondary", False)}, + "technical_institution_student": {YEAR: caretaker.get("technical", False)}, + "co_ccap_incapacitated": {MONTH: caretaker["incapacitated"]}, + "co_ccap_other_activity": {MONTH: caretaker.get("other_activity", "NONE")}, + } + + +def simulate( + caretakers, + spm_unit=None, + other_adult=None, + child=None, + link_parents=False, + second_files_apart=False, +): + names = [f"caretaker{index}" for index in range(len(caretakers))] + people = {name: person_input(item) for name, item in zip(names, caretakers)} + people["child"] = {"age": {YEAR: 3}, **(child or {})} + family = names + ["child"] + if link_parents: + # Ids start at 1, since 0 means an unknown parent. + for index, name in enumerate(family): + people[name]["person_id"] = {YEAR: index + 1} + for slot, index in zip(("parent_1_id", "parent_2_id"), range(len(names))): + people["child"][slot] = {YEAR: index + 1} + if second_files_apart and len(names) > 1: + tax_units = { + "claiming": {"members": [names[0], "child"]}, + "apart": {"members": names[1:]}, + } + else: + tax_units = {"claiming": {"members": family}} + members = list(family) + if other_adult is not None: + people["other_adult"] = {"age": {YEAR: 60}, **other_adult} + tax_units["other"] = {"members": ["other_adult"]} + members.append("other_adult") + situation = { + "people": people, + "tax_units": tax_units, + "spm_units": { + "spm_unit": { + "members": members, + "spm_unit_pre_subsidy_childcare_expenses": {YEAR: 12_000}, + **(spm_unit or {}), + } + }, + "families": {"family": {"members": members}}, + "marital_units": {name: {"members": [name]} for name in people}, + "households": { + "household": { + "members": members, + "state_name": {YEAR: "CO"}, + } + }, + } + return Simulation(situation=situation) + + +def activity_eligible(simulation): + return bool(simulation.calculate("co_ccap_activity_eligible", MONTH)[0]) + + +def in_activity(caretaker): + # Like the model, this divides all earnings by all hours: the inputs hold one + # figure for weekly hours, so a job and a business can't be timed apart. + earnings = max(caretaker["wages"], 0) + max(caretaker["business"], 0) + weeks = caretaker["weeks"] or WEEKS_IN_YEAR + floor = MINIMUM_WAGE * caretaker["hours"] * weeks + studies = any( + caretaker.get(flag, False) + for flag in ("student", "part_time", "secondary", "technical") + ) + works = weeks == WEEKS_IN_YEAR and caretaker["hours"] > 0 and earnings >= floor + return studies or works + + +def rule_says_eligible(caretakers): + active = [in_activity(item) for item in caretakers] + covered = [ + is_active or item["incapacitated"] + for is_active, item in zip(active, caretakers) + ] + return any(active) and all(covered) + + +@settings(max_examples=25, deadline=None) +@given(family=st.lists(caretakers, min_size=1, max_size=2)) +# A dollar below and exactly at the floor for 2,080 hours. +@example( + family=[ + { + "wages": 15_079, + "business": 0, + "hours": 40, + "weeks": 52, + "student": False, + "incapacitated": False, + } + ] +) +@example( + family=[ + { + "wages": 15_080, + "business": 0, + "hours": 40, + "weeks": 52, + "student": False, + "incapacitated": False, + } + ] +) +# An incapacitated caretaker alone, and beside a working caretaker. +@example( + family=[ + { + "wages": 0, + "business": 0, + "hours": 0, + "weeks": 0, + "student": False, + "incapacitated": True, + } + ] +) +@example( + family=[ + { + "wages": 20_000, + "business": 0, + "hours": 40, + "weeks": 52, + "student": False, + "incapacitated": False, + }, + { + "wages": 0, + "business": 0, + "hours": 0, + "weeks": 0, + "student": False, + "incapacitated": True, + }, + ] +) +def test_activity_requirement_follows_the_rule(family): + simulation = simulate(family) + assert activity_eligible(simulation) == rule_says_eligible(family) + + +@settings(max_examples=15, deadline=None) +@given(family=st.lists(caretakers, min_size=1, max_size=2)) +def test_no_family_without_the_requirement_receives_a_subsidy(family): + simulation = simulate(family) + eligible = bool(simulation.calculate("co_ccap_eligible", MONTH)[0]) + subsidy = float(simulation.calculate("co_ccap_subsidy", MONTH)[0]) + if not activity_eligible(simulation): + assert not eligible + assert subsidy == 0 + if eligible: + assert activity_eligible(simulation) + assert subsidy >= 0 + + +@settings(max_examples=15, deadline=None) +@given( + family=st.lists(caretakers, min_size=1, max_size=2), + raise_by=st.integers(min_value=1, max_value=40_000), +) +def test_more_earnings_never_remove_the_activity(family, raise_by): + before = activity_eligible(simulate(family)) + raised = [{**family[0], "wages": family[0]["wages"] + raise_by}] + family[1:] + after = activity_eligible(simulate(raised)) + assert after >= before + + +@settings(max_examples=15, deadline=None) +@given( + family=st.lists(caretakers, min_size=1, max_size=2), + other_earnings=st.integers(min_value=0, max_value=60_000), +) +def test_an_unnamed_separate_filer_does_not_change_the_answer(family, other_earnings): + alone = activity_eligible(simulate(family)) + beside = simulate(family, other_adult={"employment_income": {YEAR: other_earnings}}) + assert activity_eligible(beside) == alone + + +NO_ACTIVITY = { + "wages": 0, + "business": 0, + "hours": 0, + "weeks": 0, + "student": False, + "part_time": False, + "incapacitated": False, +} +WORKING = {**NO_ACTIVITY, "wages": 30_000, "hours": 40, "weeks": 52} + + +@settings(max_examples=15, deadline=None) +@given(family=st.lists(caretakers, min_size=2, max_size=2)) +# A working mother and a father at home who files separately. +@example(family=[WORKING, NO_ACTIVITY]) +# An incapacitated mother and a working father who files separately. +@example(family=[{**NO_ACTIVITY, "incapacitated": True}, WORKING]) +def test_parent_ids_make_tax_filing_irrelevant(family): + together = activity_eligible(simulate(family, link_parents=True)) + apart = activity_eligible( + simulate(family, link_parents=True, second_files_apart=True) + ) + assert together == apart == rule_says_eligible(family) + + +def test_a_family_with_no_activity_fails_without_an_exempt_path(): + assert not activity_eligible(simulate([NO_ACTIVITY])) + + +@pytest.mark.parametrize( + "path", + [ + {"caretakers": [{**NO_ACTIVITY, "other_activity": "JOB_SEARCH"}]}, + {"caretakers": [{**NO_ACTIVITY, "other_activity": "COLORADO_WORKS"}]}, + {"spm_unit": {"co_ccap_homelessness_stabilization": {MONTH: True}}}, + {"child": {"co_ccap_child_welfare_activity_waiver": {MONTH: True}}}, + ], +) +def test_each_approved_path_qualifies_a_family(path): + assert activity_eligible(simulate(**({"caretakers": [NO_ACTIVITY]} | path))) + + +def test_tanf_receipt_alone_is_not_an_exempt_path(): + # Under 3.111(D)(6) and 3.115(C), caretakers of children who receive basic + # cash assistance must meet the low-income activity test. + tanf = {"spm_unit": {"is_tanf_enrolled": {MONTH: True}}} + assert not activity_eligible(simulate([NO_ACTIVITY], **tanf)) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_activity_eligible.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_activity_eligible.py new file mode 100644 index 00000000000..01489cbe2f0 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_activity_eligible.py @@ -0,0 +1,21 @@ +from policyengine_us.model_api import * + + +class co_ccap_activity_eligible(Variable): + value_type = bool + entity = SPMUnit + label = "Meets the Colorado Child Care Assistance Program activity requirement" + definition_period = MONTH + defined_for = StateCode.CO + reference = ( + # PDF pages 1-3, 11, 15, 17-21, 24-25, 30, 35, 37-40, 48 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=1", + # PDF pages 2, 31, 33-37, 39-40, 47-49, 63, 68-72 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12658&fileName=8%20CCR%201403-1#page=2", + # PDF pages 14-18 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11042&fileName=8%20CCR%201403-1#page=14", + "https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-A/part-98/subpart-C/section-98.21#p-98.21(a)", + ) + + def formula(spm_unit, period, parameters): + return spm_unit.any(spm_unit.members("co_ccap_child_activity_eligible", period)) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_hours.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_hours.py new file mode 100644 index 00000000000..8d9faf7d3e0 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_hours.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class co_ccap_business_hours(Variable): + value_type = float + entity = Person + label = "Verified Colorado CCCAP hours in self-employment" + documentation = ( + "Hours for the business the caretaker is verifying for this month. " + "Use the same period as the verified profit. Supply zero for a month " + "without that work. A missing value is represented by -1." + ) + definition_period = MONTH + defined_for = StateCode.CO + default_value = -1 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=19" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(-1) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_profit.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_profit.py new file mode 100644 index 00000000000..846b8c4cf1f --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_business_profit.py @@ -0,0 +1,22 @@ +from policyengine_us.model_api import * + + +class co_ccap_business_profit(Variable): + value_type = float + entity = Person + label = "Verified Colorado CCCAP self-employment profit" + documentation = ( + "Gross receipts less CCCAP-allowable verified expenses for the hours " + "reported. For nonfarm businesses, exclude equipment depreciation " + "from expenses. Supply profit and hours for a qualifying business if " + "the caretaker has more than one." + ) + definition_period = MONTH + defined_for = StateCode.CO + unit = USD + # PDF pages 19, 24-25 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=19" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(0) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_activity_eligible.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_activity_eligible.py new file mode 100644 index 00000000000..0d6cf427419 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_activity_eligible.py @@ -0,0 +1,129 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.household.demographic.person._parent_links import ( + co_resident_parent_indices, + group_member_indices, +) + + +class co_ccap_child_activity_eligible(Variable): + value_type = bool + entity = Person + label = "Child meets Colorado CCAP eligibility and caretaker activity requirements" + definition_period = MONTH + defined_for = StateCode.CO + reference = ( + # PDF pages 1-3, 11, 15, 17-21, 24-25, 30, 35, 37-40, 48 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=1", + # PDF pages 2, 31, 33-37, 39-40, 47-49, 63, 68-72 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12658&fileName=8%20CCR%201403-1#page=2", + # PDF pages 14-18 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11042&fileName=8%20CCR%201403-1#page=14", + "https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-A/part-98/subpart-C/section-98.21#p-98.21(a)", + ) + + def formula(person, period, parameters): + p = parameters(period).gov + year = period.this_year + minimum_wage = p.dol.minimum_wage + + wages = person("co_ccap_work_wages", period) + work_hours = person("co_ccap_work_hours", period) + profit = person("co_ccap_business_profit", period) + business_hours = person("co_ccap_business_hours", period) + verified_work = ((work_hours > 0) & (wages >= work_hours * minimum_wage)) | ( + (business_hours > 0) & (profit >= business_hours * minimum_wage) + ) + + # Annual records approximate ongoing work for streams without monthly + # hours. Combined annual hours are an upper bound on each stream's hours. + earnings = np.sum( + [ + max_(person(source, year), 0) + * ( + work_hours < 0 + if source == "employment_income" + else business_hours < 0 + ) + for source in p.states.co.ccap.activity.earned_income_sources + ], + axis=0, + ) + weeks = person("weeks_worked", year) + weeks_at_work = where(weeks > 0, min_(weeks, WEEKS_IN_YEAR), WEEKS_IN_YEAR) + # Pre-response hours avoid a circular labor-supply dependency. + annual_hours = person("weekly_hours_worked_before_lsr", year) * weeks_at_work + annual_work = ( + (weeks_at_work == WEEKS_IN_YEAR) + & (annual_hours > 0) + & (earnings >= minimum_wage * annual_hours) + ) + works = verified_work | annual_work + + studies = person("co_ccap_in_eligible_education", year) & ( + person("co_ccap_education_weeks_remaining", period) != 0 + ) + other = person("co_ccap_other_activity", period) + allowed_treatment = p.states.co.ccap.activity.substance_use_treatment + other_activity = (other != other.possible_values.NONE) & ( + (other != other.possible_values.SUBSTANCE_USE_TREATMENT) | allowed_treatment + ) + present = ~person("is_incarcerated", period) + active = present & (works | studies | other_activity) + blocking = present & ~active & ~person("co_ccap_incapacitated", period) + + eligible_child = person("co_ccap_child_eligible", period) + low_income = child_caretakers_meet_activity( + person, year, active, blocking, p.states.co.ccap.age_limit + ) + child_welfare = person("co_ccap_child_welfare_activity_waiver", period) + stabilization = person.spm_unit("co_ccap_homelessness_stabilization", period) + return eligible_child & (low_income | child_welfare | stabilization) + + +def child_caretakers_meet_activity(person, year, active, blocking, child_age_limit): + # Attribute activity to the child even across SPM units. + first, second = co_resident_parent_indices(person, year) + linked = (first >= 0) | (second >= 0) + linked_active = ((first >= 0) & active[first]) | ((second >= 0) & active[second]) + linked_blocking = ((first >= 0) & blocking[first]) | ( + (second >= 0) & blocking[second] + ) + + # Fall back to co-resident filers. With no filer, infer a sole teen + # caretaker only when one older member can be distinguished from the child. + home = person.household.members_entity_id + row = np.arange(person.count) + filer = person("is_tax_unit_head_or_spouse", year) + age = person("age", year) + child = person("is_child", year) + has_filer = np.zeros(person.count, dtype=bool) + filer_active = np.zeros_like(has_filer) + filer_blocking = np.zeros_like(has_filer) + teen_count = np.zeros(person.count, dtype=int) + teen_active = np.zeros_like(has_filer) + for member in group_member_indices(person.tax_unit): + co_resident = (member >= 0) & (member != row) & (home[member] == home) + claims = co_resident & filer[member] + teen = ( + co_resident + & (age[member] >= child_age_limit) + & child[member] + & (age[member] > age) + ) + has_filer |= claims + filer_active |= claims & active[member] + filer_blocking |= claims & blocking[member] + teen_count += teen + teen_active |= teen & active[member] + + unlinked = where( + has_filer, filer_active & ~filer_blocking, (teen_count == 1) & teen_active + ) + # For a sole linked filer, the co-resident spouse or head in that + # filer's tax unit can be a second caretaker. A linked dependent's + # tax filers need not be the child's caretakers. + parent = where(first >= 0, first, second) + single_linked_filer = ((first >= 0) ^ (second >= 0)) & filer[parent] + linked_active |= single_linked_filer & filer_active[parent] + linked_blocking |= single_linked_filer & filer_blocking[parent] + return where(linked, linked_active & ~linked_blocking, unlinked) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_welfare_activity_waiver.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_welfare_activity_waiver.py new file mode 100644 index 00000000000..8980c80c2dd --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_child_welfare_activity_waiver.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class co_ccap_child_welfare_activity_waiver(Variable): + value_type = bool + entity = Person + label = "Child has a Colorado CCCAP child welfare activity waiver" + documentation = ( + "The child has a county protective-services placement with an open " + "child welfare case, or the county has approved Child Welfare Child " + "Care for this month." + ) + definition_period = MONTH + defined_for = StateCode.CO + # PDF pages 37-39 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=37" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(False) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_education_weeks_remaining.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_education_weeks_remaining.py new file mode 100644 index 00000000000..f42a0745e0e --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_education_weeks_remaining.py @@ -0,0 +1,17 @@ +from policyengine_us.model_api import * + + +class co_ccap_education_weeks_remaining(Variable): + value_type = int + entity = Person + label = "Approved Colorado CCCAP education weeks remaining" + documentation = ( + "County-approved weeks of care still available for the qualifying " + "education activity in this month. Use zero when the allotment is " + "exhausted. Leave unset when weeks are unknown or no limit applies." + ) + definition_period = MONTH + defined_for = StateCode.CO + default_value = -1 + # PDF pages 20-21 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=20" diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_eligible.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_eligible.py index 4db8a20a301..bc37eed38ac 100644 --- a/policyengine_us/variables/gov/states/co/ccap/co_ccap_eligible.py +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_eligible.py @@ -9,6 +9,7 @@ class co_ccap_eligible(Variable): "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11042&fileName=8%20CCR%201403-1#page=17", "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11042&fileName=8%20CCR%201403-1#page=19", "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11042&fileName=8%20CCR%201403-1#page=31", + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12658&fileName=8%20CCR%201403-1#page=31", ) definition_period = MONTH defined_for = StateCode.CO @@ -23,6 +24,8 @@ def formula(spm_unit, period, parameters): "co_ccap_re_determination_eligible", period ) - return (in_entry_process & entry_eligible) | ( - in_re_determination_process & re_determination_eligible + activity_eligible = spm_unit("co_ccap_activity_eligible", period) + return activity_eligible & ( + (in_entry_process & entry_eligible) + | (in_re_determination_process & re_determination_eligible) ) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_homelessness_stabilization.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_homelessness_stabilization.py new file mode 100644 index 00000000000..eac93f977f5 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_homelessness_stabilization.py @@ -0,0 +1,19 @@ +from policyengine_us.model_api import * + + +class co_ccap_homelessness_stabilization(Variable): + value_type = bool + entity = SPMUnit + label = "Colorado CCCAP homelessness stabilization is authorized" + documentation = ( + "The family is experiencing homelessness and has an authorized CCCAP " + "stabilization period covering this month." + ) + definition_period = MONTH + defined_for = StateCode.CO + # PDF pages 39-40 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=39" + + def formula(spm_unit, period, parameters): + # Verification applies to the reported month. + return spm_unit.filled_array(False) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_in_eligible_education.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_in_eligible_education.py new file mode 100644 index 00000000000..e0b58fb1582 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_in_eligible_education.py @@ -0,0 +1,41 @@ +from policyengine_us.model_api import * + + +class co_ccap_in_eligible_education(Variable): + value_type = bool + entity = Person + label = "Enrolled in education or training that counts as a Colorado Child Care Assistance Program activity" + documentation = ( + "Defaults to reported K-12, secondary school or equivalent, technical " + "training, full-time student, or full- or part-time college enrollment. " + "Set to true " + "for other qualifying basic education or training and to false " + "for graduate school or a second bachelor's degree. Use " + "co_ccap_education_weeks_remaining to report when the county " + "allotment for the activity runs out." + ) + definition_period = YEAR + defined_for = StateCode.CO + reference = ( + # PDF pages 3, 20-21 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=3", + # PDF pages 4, 39-40 + "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12658&fileName=8%20CCR%201403-1#page=4", + ) + + def formula(person, period, parameters): + enrollment = ( + person("is_full_time_college_student", period) + | person("is_part_time_college_student", period) + | person("is_in_secondary_school", period) + | person("technical_institution_student", period) + ) + + # These legacy inputs also have age-based defaults. Count only + # the values supplied for this year. + branch = person.simulation.branch_name + for name in ("is_in_k12_school", "is_full_time_student"): + value = person(name, period) + if period in person.get_holder(name).get_input_periods(branch): + enrollment |= value + return enrollment diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_incapacitated.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_incapacitated.py new file mode 100644 index 00000000000..4ea9cad66c2 --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_incapacitated.py @@ -0,0 +1,18 @@ +from policyengine_us.model_api import * + + +class co_ccap_incapacitated(Variable): + value_type = bool + entity = Person + label = "Colorado CCCAP caretaker is unable to provide care" + documentation = ( + "Supply the medically verified determination that this caretaker " + "cannot care for the child in this month. Inability to provide " + "self-care is used as a proxy when the determination is unavailable." + ) + definition_period = MONTH + defined_for = StateCode.CO + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=17" + + def formula(person, period, parameters): + return person("is_incapable_of_self_care", period.this_year) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_other_activity.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_other_activity.py new file mode 100644 index 00000000000..87c86fbd44f --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_other_activity.py @@ -0,0 +1,36 @@ +from policyengine_us.model_api import * + + +class COCCAPOtherActivity(Enum): + NONE = "No other eligible activity" + JOB_SEARCH = "Approved job search after qualifying cessation" + PROTECTED_BREAK = "Protected break from an eligible activity" + BUSINESS_LAUNCH = "Approved self-employment launch" + COLORADO_WORKS = "Allowable Colorado Works activity under an individualized plan" + SUBSTANCE_USE_TREATMENT = "Qualifying substance use disorder treatment" + + +class co_ccap_other_activity(Variable): + value_type = Enum + possible_values = COCCAPOtherActivity + default_value = COCCAPOtherActivity.NONE + entity = Person + label = "Other approved Colorado CCCAP activity for the month" + documentation = ( + "Report an approved activity for the caretaker only in a month it " + "covers. Use job search after a qualifying cessation if the prior " + "determination and the authorized search period cover this month. " + "Use a protected break, business launch, Colorado Works plan, or " + "qualifying treatment only while the applicable conditions are met. " + "Treatment must be licensed, appropriately endorsed, and at intensive " + "outpatient level or higher. Approval can cover up to one year per " + "instance." + ) + definition_period = MONTH + defined_for = StateCode.CO + # PDF pages 18-21, 30, 35 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=18" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(COCCAPOtherActivity.NONE.index) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_subsidy.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_subsidy.py index e1936345ec1..ef697241e4e 100644 --- a/policyengine_us/variables/gov/states/co/ccap/co_ccap_subsidy.py +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_subsidy.py @@ -8,12 +8,23 @@ class co_ccap_subsidy(Variable): unit = USD definition_period = MONTH defined_for = "co_ccap_eligible" + # 8 CCR 1403-1 3.132(A), PDF page 69 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=69" def formula(spm_unit, period, parameters): - expenses = add( - spm_unit, + person = spm_unit.members + charges = add( + person, period, ["pre_subsidy_childcare_expenses", "after_school_expenses"], ) + eligible_child = person("co_ccap_child_eligible", period) + activity_eligible = person("co_ccap_child_activity_eligible", period) + mixed_activity = spm_unit.any(activity_eligible) & spm_unit.any( + eligible_child & ~activity_eligible + ) + # Where the activity test splits coverage, pay only the passing + # children's charges. Other units keep their reported total bill. + expenses = spm_unit.sum(charges * (~mixed_activity | activity_eligible)) parent_fee = spm_unit("co_ccap_parent_fee", period) return max_(expenses - parent_fee, 0) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_hours.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_hours.py new file mode 100644 index 00000000000..060a8500e8a --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_hours.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class co_ccap_work_hours(Variable): + value_type = float + entity = Person + label = "Verified Colorado CCCAP hours at a wage job" + documentation = ( + "Hours for the wage job the caretaker is verifying for this month. Use " + "the same pay period as the reported wages. Supply zero for a month " + "without that work. A missing value is represented by -1." + ) + definition_period = MONTH + defined_for = StateCode.CO + default_value = -1 + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=19" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(-1) diff --git a/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_wages.py b/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_wages.py new file mode 100644 index 00000000000..b041db32e7f --- /dev/null +++ b/policyengine_us/variables/gov/states/co/ccap/co_ccap_work_wages.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class co_ccap_work_wages(Variable): + value_type = float + entity = Person + label = "Verified Colorado CCCAP gross wages at a job" + documentation = ( + "Gross wages for the job and pay period used for the verified hours. " + "Supply wages and hours for a qualifying job if the caretaker has " + "more than one." + ) + definition_period = MONTH + defined_for = StateCode.CO + unit = USD + reference = "https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=12277&fileName=8%20CCR%201403-1#page=19" + + def formula(person, period, parameters): + # Verification applies to the reported month. + return person.filled_array(0)