money: rent detection matches whole words ("living with parents" is not the rent)
Some checks failed
Deploy production / deploy (push) Failing after 1m6s

The scenario move date came from the first Joint item matching /rent|huur/,
which since the "Groceries (living with parents)" item matched that one, so
the scenarios never moved out (no rent, the pre-move contribution forever).
This commit is contained in:
2026-10-26 01:20:32 +00:00
parent 807a6b3104
commit d5e2ec346b
2 changed files with 13 additions and 2 deletions

View File

@@ -350,7 +350,8 @@ export function scenarioInputs(input: {
const isJoint = (item: ScenarioRecurring) =>
item.accountId !== null && jointIds.has(item.accountId);
const household = recurring.filter((item) => isJoint(item) && item.amountCents < 0);
const rent = household.find((item) => /rent|huur/i.test(item.name));
// Whole words: "Groceries (living with parents)" is not the rent.
const rent = household.find((item) => /\b(rent|huur)\b/i.test(item.name));
const oneOffs = [...input.forecasts, ...input.futureTransactions]
.filter(
(item) =>