feat(rules): preview what a rule would change before applying it
ci / lint-test (push) Successful in 34s

Selecting a rule now shows the transactions it would alter, so a subset can be
ticked and applied rather than trusting a bulk run. The apply step takes explicit
transaction ids (the existing bulk apply_rule path), so what you tick is exactly
what changes - a rule whose conditions are too broad cannot reach further than
the preview showed.

Matches are split into 'would change' and 'already correct'. A merchant
normalisation rule matching 400 rows where 380 already hold the right value is 20
changes and 380 rows of noise; only the 20 are listed.

Preview is offered for every rule including manual_only quick actions, which
previously had no way to see their reach at all. A rule with no conditions
matches every transaction - that is how apply already behaves, so the preview
reports it prominently rather than hiding it.

Applies still snapshot to rule_apply_runs, so they remain revertable.
This commit is contained in:
2026-07-26 15:08:29 +10:00
parent 31a8177958
commit cc852e7c6f
5 changed files with 375 additions and 3 deletions
+3
View File
@@ -42,3 +42,6 @@ yarn-error.log*
next-env.d.ts
/src/generated/prisma
# Raw statement exports — real financial data, never commit
dump/