Mortgage category not auto-detected as debt (snowball DEBT_LIKE_CLAUSES gap) #50

Closed
opened 2026-05-16 21:43:00 -05:00 by null · 0 comments
Owner

Severity: HIGH 🟠

Affected Files

  • routes/snowball.jsDEBT_LIKE_CLAUSES (line 13–16)
  • client/pages/SnowballPage.jsxmortgageIncluded warning logic

Problem

The debt detection in routes/snowball.js uses:

const DEBT_LIKE_CLAUSES = [
  { column: 'category_name', op: 'LIKE', value: '%credit%' },
  { column: 'category_name', op: 'LIKE', value: '%loan%' },
  { column: 'category_name', op: 'LIKE', value: '%debt%' },
];

A category named "Mortgage" or "Housing" matches none of these patterns. The bill only appears on the snowball page if the user manually toggles snowball_include = 1.

The seed data sets snowball_include: true on the mortgage bill so demos work fine. But a real user who creates a bill under a "Mortgage" category and doesn't toggle the flag will never see it on the snowball page.

Meanwhile, the frontend's mortgageIncluded warning logic in SnowballPage.jsx implies this was intended to auto-detect mortgage categories.

Impact

  • Users with mortgage/housing categories won't see those bills on the snowball page by default
  • Demo data hides the bug because snowball_include is pre-set
  • Inconsistent with the frontend's assumption that mortgages are detected

Fix

Add mortgage and housing patterns to DEBT_LIKE_CLAUSES:

const DEBT_LIKE_CLAUSES = [
  { column: 'category_name', op: 'LIKE', value: '%credit%' },
  { column: 'category_name', op: 'LIKE', value: '%loan%' },
  { column: 'category_name', op: 'LIKE', value: '%debt%' },
  { column: 'category_name', op: 'LIKE', value: '%mortgage%' },
  { column: 'category_name', op: 'LIKE', value: '%housing%' },
];

Also consider matching against bill_name for bills named "Mortgage" or "Rent".

Acceptance Criteria

  • Bills under a "Mortgage" category auto-appear on the snowball page
  • Bills under a "Housing" category auto-appear on the snowball page
  • Existing snowball_include manual toggle still works
  • Demo data continues to work
  • Frontend mortgageIncluded warning logic is consistent with backend detection
## Severity: HIGH 🟠 ## Affected Files - `routes/snowball.js` — `DEBT_LIKE_CLAUSES` (line 13–16) - `client/pages/SnowballPage.jsx` — `mortgageIncluded` warning logic ## Problem The debt detection in `routes/snowball.js` uses: ```javascript const DEBT_LIKE_CLAUSES = [ { column: 'category_name', op: 'LIKE', value: '%credit%' }, { column: 'category_name', op: 'LIKE', value: '%loan%' }, { column: 'category_name', op: 'LIKE', value: '%debt%' }, ]; ``` A category named **"Mortgage"** or **"Housing"** matches none of these patterns. The bill only appears on the snowball page if the user manually toggles `snowball_include = 1`. The seed data sets `snowball_include: true` on the mortgage bill so demos work fine. But a real user who creates a bill under a "Mortgage" category and doesn't toggle the flag will never see it on the snowball page. Meanwhile, the frontend's `mortgageIncluded` warning logic in `SnowballPage.jsx` implies this was intended to auto-detect mortgage categories. ## Impact - Users with mortgage/housing categories won't see those bills on the snowball page by default - Demo data hides the bug because `snowball_include` is pre-set - Inconsistent with the frontend's assumption that mortgages are detected ## Fix Add mortgage and housing patterns to `DEBT_LIKE_CLAUSES`: ```javascript const DEBT_LIKE_CLAUSES = [ { column: 'category_name', op: 'LIKE', value: '%credit%' }, { column: 'category_name', op: 'LIKE', value: '%loan%' }, { column: 'category_name', op: 'LIKE', value: '%debt%' }, { column: 'category_name', op: 'LIKE', value: '%mortgage%' }, { column: 'category_name', op: 'LIKE', value: '%housing%' }, ]; ``` Also consider matching against `bill_name` for bills named "Mortgage" or "Rent". ## Acceptance Criteria - [ ] Bills under a "Mortgage" category auto-appear on the snowball page - [ ] Bills under a "Housing" category auto-appear on the snowball page - [ ] Existing `snowball_include` manual toggle still works - [ ] Demo data continues to work - [ ] Frontend `mortgageIncluded` warning logic is consistent with backend detection
null added the
backend
priority:critical
labels 2026-05-16 21:43:00 -05:00
null closed this issue 2026-06-03 22:19:49 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/BillTracker#50
No description provided.