money: rent detection matches whole words ("living with parents" is not the rent)
Some checks failed
Deploy production / deploy (push) Failing after 1m6s
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:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user