Skip to content

fix: implement NJ same-category loss rule for gross income#7280

Open
MaxGhenis wants to merge 4 commits intomainfrom
fix/nj-same-category-loss-rule
Open

fix: implement NJ same-category loss rule for gross income#7280
MaxGhenis wants to merge 4 commits intomainfrom
fix/nj-same-category-loss-rule

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Implements New Jersey's "same category rule" (N.J.S. 54A:5-1) for gross income calculation
  • Under this rule, if any income category has a net loss, that loss is disregarded (treated as $0) and cannot offset income from other categories
  • Applies max_(0, category_total) to capital gains, partnership/S-corp income, self-employment income, farm income, and rental income

Fixes #7017

Test plan

  • Added YAML tests covering the same-category loss rule scenarios
  • Verified existing NJ integration tests still pass
  • Ran make format to ensure code style compliance

🤖 Generated with Claude Code

Fixes #7017

Under NJ's "same category rule" (N.J.S. 54A:5-1), if any of the income
categories has a net loss, that loss must be disregarded (treated as $0)
and cannot offset income from other categories.

This change applies max_(0, category_total) to:
- Capital gains (short-term + long-term combined)
- Partnership/S-corp income
- Self-employment income
- Farm income
- Rental income

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

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (67abb79) to head (c4d23f8).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #7280       +/-   ##
============================================
+ Coverage   72.11%   100.00%   +27.88%     
============================================
  Files        3794         1     -3793     
  Lines       54662        16    -54646     
  Branches      275         1      -274     
============================================
- Hits        39418        16    -39402     
+ Misses      15228         0    -15228     
+ Partials       16         0       -16     
Flag Coverage Δ
unittests 100.00% <100.00%> (+27.88%) ⬆️

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.

MaxGhenis and others added 2 commits February 2, 2026 23:50
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis requested a review from DTrim99 February 4, 2026 01:52
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

NJ gross income incorrectly includes net losses from income categories; missing 'same category rule'

1 participant