diff --git a/changelog.d/ak-atap-earned-income-disregard-tiers.fixed.md b/changelog.d/ak-atap-earned-income-disregard-tiers.fixed.md new file mode 100644 index 00000000000..b8d7af17e02 --- /dev/null +++ b/changelog.d/ak-atap-earned-income-disregard-tiers.fixed.md @@ -0,0 +1 @@ +Applied Alaska ATAP’s earned income disregard tiers using individual receipt and qualifying earnings history. diff --git a/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/later_rates.yaml b/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/later_rates.yaml new file mode 100644 index 00000000000..45c76da633e --- /dev/null +++ b/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/later_rates.yaml @@ -0,0 +1,42 @@ +description: Alaska excludes these shares of earnings remaining after the flat work incentive deduction based on the number of prior qualifying earnings months. + +brackets: + - threshold: + 2013-12-31: 12 + amount: + 2005-01-01: null + 2013-12-31: 0.25 + - threshold: + 2013-12-31: 24 + amount: + 2005-01-01: null + 2013-12-31: 0.20 + - threshold: + 2013-12-31: 36 + amount: + 2005-01-01: null + 2013-12-31: 0.15 + - threshold: + 2013-12-31: 48 + amount: + 2005-01-01: null + 2013-12-31: 0.10 + - threshold: + 2013-12-31: 60 + amount: + 2005-01-01: null + 2013-12-31: 0 + +metadata: + type: single_amount + threshold_unit: month + amount_unit: /1 + period: month + label: Alaska ATAP work incentive percentage rates after the first tier + reference: + - title: 7 AAC 45.480(b)-(d) - Deductions from income + href: https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480 + - title: Alaska TANF State Plan effective December 31, 2013, section 13.2 + href: https://aws.state.ak.us/OnlinePublicNotices/Notices/Attachment.aspx?id=93326#page=27 + - title: "Alaska TANF State Plan (2026–2028), section 12.2 #page 23-24" + href: https://health.alaska.gov/media/hgja52sa/alaska-tanf-state-plan-2026-2028.pdf#page=23 diff --git a/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/rate.yaml b/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/rate.yaml index 1b1c1476a12..ef588de02a2 100644 --- a/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/rate.yaml +++ b/policyengine_us/parameters/gov/states/ak/dpa/atap/income/work_incentive/rate.yaml @@ -1,6 +1,4 @@ -description: Alaska excludes this share of remaining earned income after the flat deduction under the Alaska Temporary Assistance Program. -# NOTE: Tier 1 rate applies to months 1-12 of participation. Subsequent tiers -# (25%/20%/15%/10%/0%) span 12-month blocks beyond the first year. +description: Alaska excludes this share of remaining earned income after the flat deduction in the first tier of the work incentive deduction. values: 2005-01-01: 0.33 @@ -10,5 +8,5 @@ metadata: period: month label: Alaska ATAP work incentive percentage rate reference: - - title: 7 AAC 45.480(b) - Deductions from income - href: https://www.law.cornell.edu/regulations/alaska/7-AAC-45.480 + - title: 7 AAC 45.480(b)(1) - Deductions from income + href: https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480 diff --git a/policyengine_us/system.py b/policyengine_us/system.py index a732006d8ed..2d155e82e39 100644 --- a/policyengine_us/system.py +++ b/policyengine_us/system.py @@ -612,6 +612,23 @@ def __init__(self, *args, **kwargs): _sync_input_variables(self) _rebuild_baseline_branch(self) + def set_input(self, variable_name, period, value): + result = super().set_input(variable_name, period, value) + if variable_name in { + "receives_tanf", + "is_tanf_enrolled", + "ak_atap_received_benefits_person", + "ak_atap_earnings_month_status", + "ak_atap_prior_earnings_months", + "ak_atap_work_incentive_eligible_person", + } and self.get_holder( + "ak_atap_countable_earned_income_person" + ).get_known_periods(self.branch_name): + # Newly supplied history can change later ATAP amounts even when + # no calculation previously read that month. + self.drop_computed_arrays() + return result + def _download_or_explain(dataset_str, download): """Name the unresolved dataset URI instead of re-raising a Hub exception. diff --git a/policyengine_us/tests/core/test_ak_atap_history.py b/policyengine_us/tests/core/test_ak_atap_history.py new file mode 100644 index 00000000000..458c42a9c26 --- /dev/null +++ b/policyengine_us/tests/core/test_ak_atap_history.py @@ -0,0 +1,38 @@ +from policyengine_us import Simulation + + +def test_adding_atap_receipt_history_recalculates_countable_income(): + simulation = Simulation( + situation={ + "people": { + "adult": {"employment_income_before_lsr": {"2025": 9600, "2026": 9600}}, + "child": {"age": {"2026": 8}}, + }, + "spm_units": { + "unit": { + "members": ["adult", "child"], + "is_tanf_enrolled": {"2026-01": True}, + } + }, + "households": { + "home": { + "members": ["adult", "child"], + "state_code": {"2025": "AK", "2026": "AK"}, + } + }, + } + ) + variable = "ak_atap_countable_earned_income_person" + assert simulation.calculate(variable, "2026-01").tolist() == [435.5, 0] + assert simulation.calculate("ak_atap_countable_income", "2026-01").tolist() == [ + 435.5 + ] + + for month in range(1, 13): + simulation.set_input("receives_tanf", f"2025-{month:02}", [True]) + + # ($800 - $150) * 75% = $487.50 after twelve qualifying earnings months. + assert simulation.calculate(variable, "2026-01").tolist() == [487.5, 0] + assert simulation.calculate("ak_atap_countable_income", "2026-01").tolist() == [ + 487.5 + ] diff --git a/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/ak_atap_countable_earned_income_person.yaml b/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/ak_atap_countable_earned_income_person.yaml index 35b93e529d1..f6812be46b7 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/ak_atap_countable_earned_income_person.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/ak_atap_countable_earned_income_person.yaml @@ -1,8 +1,8 @@ # Unit tests for Alaska ATAP countable earned income per person # 7 AAC 45.480 - Work incentive deduction -# https://www.law.cornell.edu/regulations/alaska/7-AAC-45.480 +# https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480 # New applicants: $90 flat deduction -# Continuing recipients: $150 flat + 33% of remainder +# Continuing recipients: $150 flat plus a percentage of remaining earnings - name: New applicant with $500 earned income period: 2026-01 @@ -122,3 +122,276 @@ state_code: AK output: ak_atap_countable_earned_income_person: [0] + +- name: Continuing recipient in the 13th month with earnings + period: 2026-01 + input: + people: + adult: + age: 30 + rent: 18_000 + employment_income_before_lsr: + 2025: 9_600 + 2026: 9_600 + child: + age: 8 + spm_units: + spm_unit: + members: [adult, child] + is_tanf_enrolled: + 2025-01: true + 2025-02: true + 2025-03: true + 2025-04: true + 2025-05: true + 2025-06: true + 2025-07: true + 2025-08: true + 2025-09: true + 2025-10: true + 2025-11: true + 2025-12: true + 2026-01: true + households: + household: + members: [adult, child] + state_code: {2025: AK, 2026: AK} + output: + # Monthly wages are $9,600 / 12 = $800. The child has no earnings. + # Twelve prior months with assistance and earnings give a 25% disregard. + # Countable income is ($800 - $150) * (1 - 0.25) = $487.50. + ak_atap_countable_earned_income_person: [487.5, 0] + ak_atap_countable_income: 487.5 + +- name: Payment below $10 advances the tier and can make the unit ineligible + period: 2026-01 + input: + people: + adult: + <<: &earner {age: 30, rent: 18_000, employment_income_before_lsr: {2025: 9_600, 2026: 9_600}} + unemployment_compensation: {2026: 17_400} + ak_atap_earnings_month_status: {2025-01: BELOW_MINIMUM_PAYMENT} + child: &child {age: 8} + spm_units: &eleven_payments + unit: + members: [adult, child] + receives_tanf: + <<: &paid_feb_dec { + 2025-02: true, 2025-03: true, 2025-04: true, 2025-05: true, + 2025-06: true, 2025-07: true, 2025-08: true, 2025-09: true, + 2025-10: true, 2025-11: true, 2025-12: true} + 2025-01: false + 2026-01: true + households: &alaska + home: {members: [adult, child], state_code: {2025: AK, 2026: AK}} + output: &ineligible_at_tier_two + # The January 2025 amount is ($1,857 - $1,840) * $821 / $1,857, about $7.52. + # The January 2026 countable earnings are ($800 - $150) * 75% = $487.50. + # $487.50 + $17,400 / 12 = $1,937.50, above the $1,908 need standard. + ak_atap_countable_earned_income_person: [487.5, 0] + ak_atap_countable_income: 1937.5 + ak_atap_net_income_eligible: false + +- name: Refused payment while eligible advances the tier + period: 2026-01 + input: + people: + adult: + <<: *earner + unemployment_compensation: {2026: 17_400} + ak_atap_earnings_month_status: {2025-01: PAYMENT_REFUSED} + child: *child + spm_units: *eleven_payments + households: *alaska + # Twelve qualifying months give ($800 - $150) * 75% = $487.50. + output: *ineligible_at_tier_two + +- name: A month with an earnings deduction denial advances the tier + period: 2026-01 + input: + people: + adult: {<<: *earner, ak_atap_earnings_month_status: {2025-01: DEDUCTION_DENIED}} + child: *child + spm_units: *eleven_payments + households: *alaska + output: &tier_two + # Eleven paid months plus one other qualifying month give ($800 - $150) * 75% = $487.50. + ak_atap_countable_earned_income_person: [487.5, 0] + +- name: A month with a penalty and earnings advances the tier + period: 2026-01 + input: + people: + adult: {<<: *earner, ak_atap_earnings_month_status: {2025-01: PENALTY}} + child: *child + spm_units: *eleven_payments + households: *alaska + # Twelve qualifying months give ($800 - $150) * 75% = $487.50. + output: *tier_two + +- name: Suspension, ineligibility and zero earnings do not advance the tier + period: 2026-01 + input: + people: + adult: + <<: *earner + employment_income_before_lsr: {2024: 9_600, 2025: 9_600, 2026: 9_600} + ak_atap_earnings_month_status: {2025-01: SUSPENDED, 2025-02: INELIGIBLE, 2025-03: PENALTY} + tanf_gross_earned_income: {2025-03: 0} + child: *child + spm_units: + unit: + members: [adult, child] + # The historical enrollment reports include the suspended and ineligible months. + is_tanf_enrolled: {<<: *paid_feb_dec, 2024-11: true, 2024-12: true, 2025-01: true} + households: + home: {members: [adult, child], state_code: {2024: AK, 2025: AK, 2026: AK}} + output: &tier_one + # Fourteen listed months minus three exclusions give ($800 - $150) * 67% = $435.50. + ak_atap_countable_earned_income_person: [435.5, 0] + +- name: TANF paid by another state does not advance the Alaska tier + period: 2026-01 + input: + people: + adult: + <<: *earner + employment_income_before_lsr: {2024: 9_600, 2025: 9_600, 2026: 9_600} + child: *child + spm_units: + unit: + members: [adult, child] + receives_tanf: { + 2024-01: true, 2024-02: true, 2024-03: true, 2024-04: true, + 2024-05: true, 2024-06: true, 2024-07: true, 2024-08: true, + 2024-09: true, 2024-10: true, 2024-11: true, 2025-12: true, 2026-01: true} + households: + home: {members: [adult, child], state_code: {2024: WA, 2025: AK, 2026: AK}} + # One Alaska month gives ($800 - $150) * 67% = $435.50. + output: *tier_one + +- name: A returning applicant qualifies when paid in the preceding four months + period: 2026-01 + input: + people: &family {adult: *earner, child: *child} + spm_units: + unit: + members: [adult, child] + receives_tanf: {<<: *paid_feb_dec, 2025-01: true, 2026-01: false} + households: *alaska + # December receipt and 12 qualifying months give ($800 - $150) * 75% = $487.50. + output: *tier_two + +- name: A payment four months ago satisfies the receipt test + period: 2026-01 + input: + people: *family + spm_units: + unit: {members: [adult, child], receives_tanf: {2025-09: true, 2026-01: false}} + households: *alaska + # September is four months before January. ($800 - $150) * 67% = $435.50. + output: *tier_one + +- name: A payment five months ago and current enrollment do not satisfy the receipt test + period: 2026-01 + input: + people: *family + spm_units: + unit: + members: [adult, child] + is_tanf_enrolled: {2026-01: true} + receives_tanf: {2025-08: true, 2025-09: false, 2025-10: false, 2025-11: false, 2025-12: false, 2026-01: true} + households: *alaska + output: &initial + # No payment in the preceding four months gives $800 - $90 = $710. + ak_atap_countable_earned_income_person: [710, 0] + +- name: A disqualified alien parent gets the initial deduction in a recipient unit + period: 2026-01 + input: + people: + adult: {<<: *earner, is_citizen_or_legal_immigrant: {2026: false}} + child: *child + spm_units: + unit: + members: [adult, child] + receives_tanf: {<<: *paid_feb_dec, 2025-01: true, 2026-01: true} + households: *alaska + # The disqualified parent's countable earnings are $800 - $90 = $710. + output: *initial + +- name: Two earners can have different individual receipt within a paid unit + period: 2026-01 + input: + people: + adult: {<<: *earner, ak_atap_received_benefits_person: {2025-12: true}} + partner: {<<: *earner, ak_atap_received_benefits_person: {2025-12: false}} + child: *child + spm_units: + unit: {members: [adult, partner, child], receives_tanf: {2025-12: true}} + households: + home: {members: [adult, partner, child], state_code: {2025: AK, 2026: AK}} + output: + # Count ($800 - $150) * 67% = $435.50 for the paid earner and $800 - $90 = $710 for the other. + ak_atap_countable_earned_income_person: [435.5, 710, 0] + +- name: The 25 percent disregard applied in January 2020 + period: 2020-01 + input: + people: + adult: + <<: *earner + employment_income_before_lsr: {2019: 9_600, 2020: 9_600} + child: *child + spm_units: + unit: + members: [adult, child] + receives_tanf: { + 2019-01: true, 2019-02: true, 2019-03: true, 2019-04: true, + 2019-05: true, 2019-06: true, 2019-07: true, 2019-08: true, + 2019-09: true, 2019-10: true, 2019-11: true, 2019-12: true, 2020-01: true} + households: + home: {members: [adult, child], state_code: {2019: AK, 2020: AK}} + # Twelve qualifying months give ($800 - $150) * 75% = $487.50. + output: *tier_two + +- name: The 25 percent disregard applied in December 2025 + period: 2025-12 + input: + people: + adult: + <<: *earner + employment_income_before_lsr: {2024: 9_600, 2025: 9_600} + child: *child + spm_units: + unit: + members: [adult, child] + receives_tanf: {<<: *paid_feb_dec, 2024-12: true, 2025-01: true} + households: + home: {members: [adult, child], state_code: {2024: AK, 2025: AK}} + # December 2024 through November 2025 gives ($800 - $150) * 75% = $487.50. + output: *tier_two + +- name: Established earnings counts select each tier at its inclusive boundary + period: 2026-01 + input: + people: + adult: + <<: *earner + ak_atap_prior_earnings_months: { + 2026-01: 11, 2026-02: 12, 2026-03: 23, 2026-04: 24, 2026-05: 35, + 2026-06: 36, 2026-07: 47, 2026-08: 48, 2026-09: 59, 2026-10: 60} + child: *child + spm_units: + unit: + members: [adult, child] + receives_tanf: {2025-12: true, 2026-04: true, 2026-08: true} + households: *alaska + output: + # $800 - $150 = $650. Multiply by 67%, 75%, 80%, 85%, 90%, then 100%. + # No as-of count is supplied for November, when three recorded months give 67%. + ak_atap_countable_earned_income_person: { + 2026-01: [435.5, 0], 2026-02: [487.5, 0], 2026-03: [487.5, 0], + 2026-04: [520, 0], 2026-05: [520, 0], 2026-06: [552.5, 0], + 2026-07: [552.5, 0], 2026-08: [585, 0], 2026-09: [585, 0], + 2026-10: [650, 0], 2026-11: [435.5, 0]} diff --git a/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/integration.yaml b/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/integration.yaml index 3493b3d8d85..955f3f04512 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ak/dpa/atap/integration.yaml @@ -324,3 +324,30 @@ ak_atap_net_income_eligible: true ak_atap_eligible: true ak_atap: 867 + +- name: Continuing recipient with wages and unemployment compensation + period: 2026-01 + input: + people: + adult: + age: 30 + employment_income_before_lsr: 9_600 + unemployment_compensation: 2_400 + child: + age: 8 + spm_units: + spm_unit: + members: [adult, child] + is_tanf_enrolled: true + households: + household: + members: [adult, child] + state_code: AK + output: + # Gross income is $9,600 / 12 + $2,400 / 12 = $1,000. + # With no prior months supplied, ($800 - $150) * (1 - 0.33) = $435.50. + # Countable income is $435.50 + $200 in unemployment benefits = $635.50. + ak_atap_gross_income: 1_000 + ak_atap_countable_earned_income: 435.5 + ak_atap_countable_unearned_income: 200 + ak_atap_countable_income: 635.5 diff --git a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_countable_earned_income_person.py b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_countable_earned_income_person.py index d946e989b1c..27f9e45d3b9 100644 --- a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_countable_earned_income_person.py +++ b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_countable_earned_income_person.py @@ -1,3 +1,6 @@ +from policyengine_us.variables.gov.states.ak.dpa.atap.income.earned.ak_atap_earnings_month_status import ( + AKATAPEarningsMonthStatus as EarningsMonthStatus, +) from policyengine_us.model_api import * @@ -7,35 +10,97 @@ class ak_atap_countable_earned_income_person(Variable): label = "Alaska ATAP countable earned income per person" unit = USD definition_period = MONTH - reference = "https://www.law.cornell.edu/regulations/alaska/7-AAC-45.480" + reference = "https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480" defined_for = StateCode.AK def formula(person, period, parameters): - # Per 7 AAC 45.480: Deductions depend on applicant status - # (a)(1) New applicants: $90 flat deduction - # (a)(2) + (b) Continuing recipients: $150 flat + percentage p = parameters(period).gov.states.ak.dpa.atap.income - gross_earned = person("tanf_gross_earned_income", period) - is_enrolled = person.spm_unit("is_tanf_enrolled", period) + history_months, recent_receipt, has_history = _earnings_history(person, period) + established_months = person("ak_atap_prior_earnings_months", period) + qualifying_months = where( + established_months >= 0, established_months, history_months + ) - # New applicants: $90 flat deduction only - new_applicant_countable = max_( - gross_earned - p.deductions.initial_work_deduction, 0 + # Preserve the estimate for households without any supplied history. + current_enrollment = person.spm_unit("is_tanf_enrolled", period) + use_incentive = person("ak_atap_work_incentive_eligible_person", period) & ( + recent_receipt | (~has_history & current_enrollment) ) - # Continuing recipients: $150 flat + percentage of remainder - # NOTE: Alaska uses tiered deductions based on months receiving assistance: - # Tier 1 (months 1-12): $150 + 33% - # Tier 2 (months 13-24): $150 + 25% - # Tier 3 (months 25-36): $150 + 20% - # Tier 4 (months 37-48): $150 + 15% - # Tier 5 (months 49-60): $150 + 10% - # Beyond 60 months: $150 only (0%) - # Only Tier 1 is modeled. + rate = p.work_incentive.rate + later_rates = p.work_incentive.later_rates + if later_rates.thresholds: + rate = where( + qualifying_months >= later_rates.thresholds[0], + later_rates.calc(qualifying_months), + rate, + ).astype(np.float32) + + gross_earned = person("tanf_gross_earned_income", period) + initial = max_(gross_earned - p.deductions.initial_work_deduction, 0) after_flat = max_(gross_earned - p.work_incentive.flat, 0) - percent_disregard = after_flat * p.work_incentive.rate - continuing_countable = max_( - gross_earned - p.work_incentive.flat - percent_disregard, 0 + return where(use_incentive, after_flat - after_flat * rate, initial) + + +def _prior_input_months(person, period, variable): + simulation = person.simulation + return { + month + for month in simulation.get_holder(variable).get_input_periods( + simulation.branch_name ) + if month.unit == MONTH and month.size == 1 and month.start < period.start + } + + +def _earnings_history(person, period): + payment_months = _prior_input_months( + person, period, "ak_atap_received_benefits_person" + ) | _prior_input_months(person, period, "receives_tanf") + enrollment_months = _prior_input_months(person, period, "is_tanf_enrolled") + status_months = _prior_input_months(person, period, "ak_atap_earnings_month_status") + months_with_earnings = person.filled_array(0, dtype=int) + recent_receipt = person.filled_array(False) + has_history = person.filled_array(False) + # Section 45.480(a) looks back four full months, excluding this month. + first_recent_month = period.offset(-4).start + + for month in sorted(payment_months | enrollment_months | status_months): + alaska = person.household("state_code", month.this_year) == StateCode.AK + if month in payment_months: + paid = person("ak_atap_received_benefits_person", month) + elif month in enrollment_months: + paid = person.spm_unit("is_tanf_enrolled", month) & person( + "ak_atap_work_incentive_eligible_person", month + ) + else: + paid = person.filled_array(False) + + if month in status_months: + status = person("ak_atap_earnings_month_status", month) + no_payment = (status == EarningsMonthStatus.BELOW_MINIMUM_PAYMENT) | ( + status == EarningsMonthStatus.PAYMENT_REFUSED + ) + excluded = (status == EarningsMonthStatus.SUSPENDED) | ( + status == EarningsMonthStatus.INELIGIBLE + ) + paid = paid & ~no_payment & ~excluded + qualifies = ( + paid + | no_payment + | (status == EarningsMonthStatus.DEDUCTION_DENIED) + | (status == EarningsMonthStatus.PENALTY) + ) + has_history |= status != EarningsMonthStatus.UNREPORTED + else: + qualifies = paid + + if month in payment_months or month in enrollment_months: + has_history[:] = True + if month.start >= first_recent_month: + recent_receipt |= alaska & paid + if (alaska & qualifies).any(): + earned = person("tanf_gross_earned_income", month) + months_with_earnings += alaska & qualifies & (earned > 0) - return where(is_enrolled, continuing_countable, new_applicant_countable) + return months_with_earnings, recent_receipt, has_history diff --git a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_earnings_month_status.py b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_earnings_month_status.py new file mode 100644 index 00000000000..d59cd2c6c52 --- /dev/null +++ b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_earnings_month_status.py @@ -0,0 +1,27 @@ +from policyengine_us.model_api import * + + +class AKATAPEarningsMonthStatus(Enum): + UNREPORTED = "No exceptional circumstance reported" + BELOW_MINIMUM_PAYMENT = "Eligible, with a payment below $10" + PAYMENT_REFUSED = "Otherwise eligible; payment refused" + DEDUCTION_DENIED = "Earned income deduction denied" + PENALTY = "Penalty under 7 AAC 45.980" + SUSPENDED = "ATAP suspended" + INELIGIBLE = "Ineligible for ATAP" + + +class ak_atap_earnings_month_status(Variable): + value_type = Enum + possible_values = AKATAPEarningsMonthStatus + default_value = AKATAPEarningsMonthStatus.UNREPORTED + entity = Person + label = "Alaska ATAP earnings month status" + definition_period = MONTH + reference = "https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480" + documentation = ( + "Case history under 7 AAC 45.480(c)–(d). Below-minimum payments, " + "refusals while otherwise eligible, deduction denials and penalties " + "under 7 AAC 45.980 count if the person earned income. Suspensions " + "and ineligible months do not count." + ) diff --git a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_prior_earnings_months.py b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_prior_earnings_months.py new file mode 100644 index 00000000000..7de2547b628 --- /dev/null +++ b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_prior_earnings_months.py @@ -0,0 +1,19 @@ +from policyengine_us.model_api import * + + +class ak_atap_prior_earnings_months(Variable): + value_type = int + default_value = -1 + entity = Person + label = "Established count of prior Alaska ATAP earnings months" + definition_period = MONTH + reference = "https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480" + documentation = ( + "Supply the case record's count of qualifying months before this " + "month. Zero is a known count; the default derives the count from " + "monthly history. This input does not establish recent receipt." + ) + + def formula(person, period, parameters): + # A count is specific to its as-of month. + return person.filled_array(-1, dtype=int) diff --git a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_received_benefits_person.py b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_received_benefits_person.py new file mode 100644 index 00000000000..cfb8ab23a02 --- /dev/null +++ b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_received_benefits_person.py @@ -0,0 +1,19 @@ +from policyengine_us.model_api import * + + +class ak_atap_received_benefits_person(Variable): + value_type = bool + entity = Person + label = "Individual received Alaska ATAP benefits" + definition_period = MONTH + reference = "https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480" + documentation = ( + "Supply individual monthly payment history when unit receipt does not " + "describe everyone. By default, reported unit receipt applies to " + "individuals who can qualify for the work incentive." + ) + + def formula(person, period, parameters): + return person.spm_unit("receives_tanf", period) & person( + "ak_atap_work_incentive_eligible_person", period + ) diff --git a/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_work_incentive_eligible_person.py b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_work_incentive_eligible_person.py new file mode 100644 index 00000000000..caa41d033de --- /dev/null +++ b/policyengine_us/variables/gov/states/ak/dpa/atap/income/earned/ak_atap_work_incentive_eligible_person.py @@ -0,0 +1,18 @@ +from policyengine_us.model_api import * + + +class ak_atap_work_incentive_eligible_person(Variable): + value_type = bool + entity = Person + label = "Individual can qualify for the Alaska ATAP work incentive" + definition_period = MONTH + reference = "https://www.akleg.gov/basis/aac.asp?media=print&secStart=7.45.480&secEnd=7.45.480" + documentation = ( + "Set to false for a stepparent outside the assistance unit, a " + "disqualified alien parent or a parent whose income is deemed to " + "a minor parent under 7 AAC 45.467. Defaults to the model's " + "qualified immigration status test." + ) + + def formula(person, period, parameters): + return person("is_citizen_or_legal_immigrant", period.this_year)