feat(rules): manual-only rules as one-click quick actions on selected transactions
ci / lint-test (push) Successful in 52s
ci / lint-test (push) Successful in 52s
A rule flagged manual_only never runs in the apply-all pass; instead it shows as a button in the transactions bulk bar and applies its actions to the current selection (conditions ignored — the selection is the condition). Recorded as a rule_apply_run, so it reverts from Rules -> Apply History like any other run. Motivation: tagging Home + splitting 50/50 with Sonu was two bulk actions every time. Now it is one click, and any other combo can be defined the same way. Extracts the action-application and snapshot logic from the apply route into src/lib/rule-actions.ts so both callers share one implementation — splits upsert rather than delete+reinsert, so settled flags survive.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Manual-only rules ("quick actions"): a rule flagged manual_only is never
|
||||
-- picked up by the bulk apply-all run. It exists to be fired by hand against a
|
||||
-- selection of transactions from the transactions page, so its conditions are
|
||||
-- irrelevant — the selection is the condition.
|
||||
|
||||
ALTER TABLE rules
|
||||
ADD COLUMN IF NOT EXISTS manual_only BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_rules_manual_only
|
||||
ON rules (owner_id, manual_only) WHERE manual_only = true;
|
||||
Reference in New Issue
Block a user