Rules: undo a rule on past transactions when deleting it; warn about short text

Deleting a rule can now take back what it did: rows it changed get what the
other rules say (or Other / no category), then own transfers are looked for
again. A rule's text matches anywhere in a name, so 1-3 letters ("ing": also
Stichting, Payments, every ING IBAN) gets a warning.

Transfers: also ING's English savings export ("Transfer to/from current
account"), "Naar Beleggingsrek." and "Incasso ING creditcard".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MangaValkandClaude Opus 5.5 committed 2026-11-19 20:55:41 +01:00
1 parent 730d99d38b
commit c7298cf955
3 files changed
+61 -6

No files matched your search

+12
View File
@@ -38,3 +38,15 @@ console.log("transfers ok");
assert.deepEqual(two.slice(0, 2), [{ id: "o1", key: "TRANSFER_OUT" }, { id: "i1", key: "TRANSFER_IN" }]);
}
console.log("own transfers ok");
// ING's own wording for its accounts, Dutch and English.
{
const r = (id: string, amount: number, name: string) => ({ id, date: "2026-10-01", amount, account_id: id, name, categoryKey: null });
const f = findOwnTransfers([
r("a", 100, "Transfer to current account NL24INGB0001234567"), r("b", -50, "Transfer from current account NL24INGB0001234567"),
r("c", 5000, "Naar Beleggingsrek. 15671748 Valutadatum: 26-08-2026"), r("d", 87.24, "Incasso ING creditcard Accountnr 210026951876 Periode juli"),
r("e", 36.93, "Naam: Alternate Nederland Omschrijving: 51312519073X"),
]);
assert.deepEqual(f.map((x) => x.id), ["a", "b", "c", "d"]);
}
console.log("ing phrases ok");
+3 -1
View File
@@ -33,7 +33,9 @@ export type OwnTransfer = { id: string; key: "TRANSFER_OUT" | "TRANSFER_IN" };
// Savings accounts at Dutch banks, by the name the other side carries: ING (Oranje) Spaarrekening, Doelspaarrekening,
// ABN AMRO Direct Sparen, Rabobank/ASN/SNS bonusrente and deposito accounts.
const SAVINGS = /spaarrekening|doelspaar|direct sparen|bonusrente|spaardeposito|vermogensspaar|spaarpot/i;
// Also ING's English savings export ("Transfer to current account NL..."), ING's investment account ("Naar
// Beleggingsrek."), and ING's monthly credit card collection ("Incasso ING creditcard Accountnr ...").
const SAVINGS = /spaarrekening|doelspaar|direct sparen|bonusrente|spaardeposito|vermogensspaar|spaarpot|beleggingsrek|transfer (to|from) (current|savings) account|incasso ing creditcard/i;
const open = (r: OwnRow) => r.categoryKey === null || r.categoryKey === "OTHER"; // a category the person chose stays
/** Pairs first (same amount out of one own account and into another within DAYS days, nearest date wins, each row used