From ef11363cb37fa20004860e6788ec9b69cc418cff Mon Sep 17 00:00:00 2001 From: David Trimmer Date: Wed, 27 Aug 2025 14:58:39 -0400 Subject: [PATCH] Implement New York Paid Family Leave payroll tax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR implements the New York Paid Family Leave (PFL) payroll tax, addressing issue #6454. ## Changes - Added parameter files for PFL contribution rates (2021-2025) and maximum annual contributions - Created variable to calculate PFL tax based on employment income with proper cap enforcement - Added comprehensive tests covering various income levels and state residency ## Implementation Details - Tax applies to gross wages (irs_employment_income) at specified annual rates - Contributions are capped at annual maximum amounts that vary by year - Only applies to New York residents (defined_for = StateCode.NY) - 2024 rate: 0.373% with $333.25 maximum - 2025 rate: 0.388% with $354.53 maximum ## Testing All tests pass successfully: - Low income ($10k): Correctly calculates $37.30 - Middle income ($50k): Correctly calculates $186.50 - High income ($100k): Correctly caps at $333.25 - Non-NY resident: Returns $0 Fixes #6454 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- changelog_entry.yaml | 4 +++ .../maximum_annual_contribution.yaml | 24 +++++++++++++ .../tax/payroll/paid_family_leave/rate.yaml | 24 +++++++++++++ .../tax/payroll/ny_paid_family_leave_tax.yaml | 35 +++++++++++++++++++ .../tax/payroll/ny_paid_family_leave_tax.py | 21 +++++++++++ 5 files changed, 108 insertions(+) create mode 100644 policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/maximum_annual_contribution.yaml create mode 100644 policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/rate.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.yaml create mode 100644 policyengine_us/variables/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..d2b7162cfd3 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - New York Paid Family Leave payroll tax diff --git a/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/maximum_annual_contribution.yaml b/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/maximum_annual_contribution.yaml new file mode 100644 index 00000000000..83905bd414e --- /dev/null +++ b/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/maximum_annual_contribution.yaml @@ -0,0 +1,24 @@ +description: New York Paid Family Leave maximum annual employee contribution. +metadata: + label: New York Paid Family Leave maximum annual contribution + unit: currency-USD + period: year + reference: + - title: Cost and Deductions - New York State Paid Family Leave + href: https://paidfamilyleave.ny.gov/cost + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2021 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2021_page + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2022 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2022 + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2023 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2023 + - title: New York Paid Family Leave Updates for 2024 + href: https://paidfamilyleave.ny.gov/2024 + - title: New York Paid Family Leave Updates for 2025 + href: https://paidfamilyleave.ny.gov/2025 +values: + 2021-01-01: 385.34 + 2022-01-01: 423.71 + 2023-01-01: 399.43 + 2024-01-01: 333.25 + 2025-01-01: 354.53 \ No newline at end of file diff --git a/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/rate.yaml b/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/rate.yaml new file mode 100644 index 00000000000..183ce6b3ebb --- /dev/null +++ b/policyengine_us/parameters/gov/states/ny/tax/payroll/paid_family_leave/rate.yaml @@ -0,0 +1,24 @@ +description: New York Paid Family Leave employee contribution rate as a percentage of gross wages. +metadata: + label: New York Paid Family Leave contribution rate + unit: /1 + period: year + reference: + - title: Cost and Deductions - New York State Paid Family Leave + href: https://paidfamilyleave.ny.gov/cost + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2021 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2021_page + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2022 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2022 + - title: Health Insurers - PFL Decision on Premium Rate for Paid Family Leave Benefits 2023 + href: https://www.dfs.ny.gov/apps_and_licensing/health_insurers/pfl_rate_decision_2023 + - title: New York Paid Family Leave Updates for 2024 + href: https://paidfamilyleave.ny.gov/2024 + - title: New York Paid Family Leave Updates for 2025 + href: https://paidfamilyleave.ny.gov/2025 +values: + 2021-01-01: 0.00511 + 2022-01-01: 0.00511 + 2023-01-01: 0.00455 + 2024-01-01: 0.00373 + 2025-01-01: 0.00388 \ No newline at end of file diff --git a/policyengine_us/tests/policy/baseline/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.yaml b/policyengine_us/tests/policy/baseline/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.yaml new file mode 100644 index 00000000000..55e0b5163d0 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.yaml @@ -0,0 +1,35 @@ +- name: Low income earner at $10,000 + period: 2024 + absolute_error_margin: 0.01 + input: + state_code: NY + irs_employment_income: 10_000 + output: + ny_paid_family_leave_tax: 37.30 # $10,000 × 0.00373 + +- name: Middle income earner at $50,000 + period: 2024 + absolute_error_margin: 0.01 + input: + state_code: NY + irs_employment_income: 50_000 + output: + ny_paid_family_leave_tax: 186.50 # $50,000 × 0.00373 + +- name: High income earner at $100,000 - should hit cap + period: 2024 + absolute_error_margin: 0.01 + input: + state_code: NY + irs_employment_income: 100_000 + output: + ny_paid_family_leave_tax: 333.25 # Capped at maximum contribution (would be $373 uncapped) + +- name: Outside New York state - should return 0 + period: 2024 + absolute_error_margin: 0.01 + input: + state_code: CA + irs_employment_income: 50_000 + output: + ny_paid_family_leave_tax: 0 # Not in NY, so no NY PFL tax \ No newline at end of file diff --git a/policyengine_us/variables/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.py b/policyengine_us/variables/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.py new file mode 100644 index 00000000000..9d405ae4103 --- /dev/null +++ b/policyengine_us/variables/gov/states/ny/tax/payroll/ny_paid_family_leave_tax.py @@ -0,0 +1,21 @@ +from policyengine_us.model_api import * + + +class ny_paid_family_leave_tax(Variable): + value_type = float + entity = Person + label = "New York Paid Family Leave payroll tax" + unit = USD + definition_period = YEAR + defined_for = StateCode.NY + reference = { + "title": "New York State Paid Family Leave", + "href": "https://paidfamilyleave.ny.gov/cost", + } + + def formula(person, period, parameters): + p = parameters(period).gov.states.ny.tax.payroll.paid_family_leave + gross_wages = person("irs_employment_income", period) + uncapped_tax = gross_wages * p.rate + max_contribution = p.maximum_annual_contribution + return min_(uncapped_tax, max_contribution)