diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..88a1428f768 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Split SSI couple amount for OAP diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap.yaml index 0c89cc4c796..ba727d0b50b 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap.yaml @@ -4,6 +4,7 @@ co_oap_eligible: true ssi_countable_income: 1_000 ssi: 0 + ssi_marital_both_eligible: false output: co_oap: 10_424 @@ -13,6 +14,7 @@ co_oap_eligible: true ssi_countable_income: 0 ssi: 2_000 + ssi_marital_both_eligible: false output: co_oap: 9_424 @@ -22,5 +24,26 @@ co_oap_eligible: true ssi_countable_income: 6_000 ssi: 6_000 + ssi_marital_both_eligible: false output: co_oap: 0 + +- name: SSI both eligible + period: 2024 + input: + people: + head: + co_oap_eligible: true + ssi_countable_income: 0 + ssi: 12_000 + ssi_marital_both_eligible: true + spouse: + co_oap_eligible: true + ssi_countable_income: 0 + ssi: 0 + ssi_marital_both_eligible: true + marital_units: + marital_unit: + members: [head, spouse] + output: + co_oap: [5_784, 5_784] diff --git a/policyengine_us/variables/gov/states/co/ssa/oap/co_oap.py b/policyengine_us/variables/gov/states/co/ssa/oap/co_oap.py index 9a95709317f..f9d5a45f1f1 100644 --- a/policyengine_us/variables/gov/states/co/ssa/oap/co_oap.py +++ b/policyengine_us/variables/gov/states/co/ssa/oap/co_oap.py @@ -10,8 +10,13 @@ class co_oap(Variable): def formula(person, period, parameters): income = person("ssi_countable_income", period) + both_eligible = person("ssi_marital_both_eligible", period) ssi = person("ssi", period) - total_countable_income = ssi + income + # The SSI variable assigns SSI to one member of the marital unit if both are eligible + marital_ssi = where( + both_eligible, person.marital_unit.sum(ssi) / 2, ssi + ) + total_countable_income = marital_ssi + income p = parameters(period).gov.states.co.ssa.oap grant_standard = p.grant_standard * MONTHS_IN_YEAR return max_(0, grant_standard - total_countable_income)