Recurring: broke finds repeating charges and pay itself, for every account

Recurring charges only came from Plaid's detection, so imported statements,
bank feeds and hand-added accounts had none (Coming up stayed empty), and a
Plaid bill dropped off Coming up once its predicted date passed.

- findRecurring (pure, tested): groups by cleaned merchant name and direction,
  finds a weekly, 2-weekly, monthly, quarterly or yearly rhythm (3 hits, 2 for
  yearly, most gaps on the rhythm). Bills may vary 40% (electricity); everyday
  spending (groceries, dining, gas) counts only at the same amount. Transfers
  skipped. Next date keeps the day of the month. Stopped ones are ended.
- saveFoundRecurring runs after every sync and after a statement import. Plaid's
  own stream wins for the same merchant. Updates keep the category you picked
  and anything you hid. Plaid streams with a past next date roll forward.

Tested: the sample CSV alone finds Geico, Planet Fitness, Spotify, Netflix,
Verizon, rent, PG&E and Comcast, and Home's Coming up fills in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minimus7andClaude Opus 5.5 committed 2026-11-11 10:19:53 -06:00
1 parent 3a4b6a0371
commit 1cf12f4619
6 files changed
+218

No files matched your search

+1
View File
@@ -132,6 +132,7 @@ export function ImportStatement({ accounts, locale, currency, link = false, trig
}
added += data?.length ?? 0;
}
if (added) await fetch("/api/recurring/find", { method: "POST" }).catch(() => null); // repeating charges in what came in
setBusy(false);
const dupes = rows.length - added;
toast(`${added} added${dupes ? `, ${dupes} already there` : ""}`);