Skip to content

Fix Stay NJ benefit formula and add Senior Freeze offset#7452

Merged
PavelMakarchuk merged 1 commit intoPolicyEngine:mainfrom
MaxGhenis:pr/nj-staynj-formula
Feb 23, 2026
Merged

Fix Stay NJ benefit formula and add Senior Freeze offset#7452
PavelMakarchuk merged 1 commit intoPolicyEngine:mainfrom
MaxGhenis:pr/nj-staynj-formula

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Wrong order of operations: Changed from min((taxes - ANCHOR) * 50%, $6,500) to max(min(taxes * 50%, $6,500) - ANCHOR - Senior_Freeze, 0) per official NJ Treasury formula
  • Senior Freeze offset: Added nj_senior_freeze input variable and subtracted it from the benefit calculation alongside ANCHOR
  • Example: $10K property taxes, $1,750 ANCHOR → was $4,125 (wrong), now $3,250 (correct)
  • Updated 25 unit tests and 7 integration tests with corrected expected values, added 2 Senior Freeze tests

Test plan

  • All 50 NJ Stay NJ tests pass with corrected values
  • Senior Freeze offset tests verify proper deduction
  • CI passes

Closes #7417

🤖 Generated with Claude Code

… offset

Per P.L. 2024 c.88, the correct formula is:
  max(min(property_taxes * 50%, $6,500) - ANCHOR - Senior_Freeze, 0)

Previously the formula was:
  min((property_taxes - ANCHOR) * 50%, $6,500)

This fixes two issues:
1. The cap ($6,500) should apply to 50% of property taxes before
   subtracting ANCHOR, not after
2. Senior Freeze benefits were not being subtracted

Also adds nj_senior_freeze as an input variable (defaults to 0).

Closes PolicyEngine#7417

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (182c387) to head (2dd3b64).
⚠️ Report is 38 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7452   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           25        24    -1     
=========================================
- Hits            25        24    -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PavelMakarchuk PavelMakarchuk merged commit 5388db6 into PolicyEngine:main Feb 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Stay NJ benefit calculation formula and Senior Freeze offset

2 participants