[PR #811] [MERGED] Add "all" or "any" conditions in rules #56998

Closed
opened 2026-05-06 20:55:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/811
Author: @albertogasparin
Created: 3/24/2023
Status: Merged
Merged: 3/29/2023
Merged by: @MatissJanis

Base: masterHead: feature/rule-every-any


📝 Commits (7)

  • 37b38dd Add "all" or "any" conditions in rules
  • 7d23059 Update tests
  • d4ccf6c Fix language nit
  • 4b9eeec Rename db column conditions_op
  • 11836ee Use array includes
  • cd4de7b Merge branch 'master' into feature/rule-every-any
  • 59baaa9 Add mapping for conditionsOp <-> conditions_op

📊 Changes

18 files changed (+204 additions, -31 deletions)

View changed files

📝 packages/desktop-client/e2e/page-models/rules-page.js (+11 -0)
📝 packages/desktop-client/e2e/schedules.test.js (+3 -3)
📝 packages/desktop-client/public/data-file-index.txt (+1 -0)
packages/desktop-client/public/data/migrations/1679728867040_rules_conditions.sql (+5 -0)
📝 packages/desktop-client/src/components/ManageRules.js (+4 -2)
📝 packages/desktop-client/src/components/modals/EditRule.js (+33 -5)
📝 packages/desktop-client/src/components/payees/ManagePayeesWithData.js (+1 -0)
packages/loot-core/migrations/1679728867040_rules_conditions.sql (+5 -0)
📝 packages/loot-core/src/server/accounts/__snapshots__/transaction-rules.test.js.snap (+6 -0)
📝 packages/loot-core/src/server/accounts/rules.js (+5 -2)
📝 packages/loot-core/src/server/accounts/rules.test.js (+54 -3)
📝 packages/loot-core/src/server/accounts/sync.test.js (+4 -0)
📝 packages/loot-core/src/server/accounts/transaction-rules.js (+32 -15)
📝 packages/loot-core/src/server/accounts/transaction-rules.test.js (+27 -1)
📝 packages/loot-core/src/server/aql/schema/index.js (+1 -0)
📝 packages/loot-core/src/server/schedules/app.js (+2 -0)
📝 packages/loot-core/src/shared/rules.js (+4 -0)
upcoming-release-notes/811.md (+6 -0)

📄 Description

This address #685 . I decided to expand the rule model to allow a conditionsOp that can either have value and or or and enables a rule to be matched based on all or any of the provided conditions.

This can be seen as a stopgap while you evaluate whenever a much more complex "conditions builder" is worth the effort (IMO not, especially if Actual adds regular expressions matchers).

Also have a couple of questions for you:

  • How do you test the server locally? I have actual-server but could not find docs on serving my dev version of actual
  • What's your opinion of the default value? I personally would migrate rules to all have this new field populated but would like to hear your thoughts
  • Is there anything I have missed that needs to be accounted for?

Thank you for your time 🙏 and hope this is appreciated 😊


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/811 **Author:** [@albertogasparin](https://github.com/albertogasparin) **Created:** 3/24/2023 **Status:** ✅ Merged **Merged:** 3/29/2023 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `feature/rule-every-any` --- ### 📝 Commits (7) - [`37b38dd`](https://github.com/actualbudget/actual/commit/37b38dd23a37215c37794bcb91065c07aa2a5772) Add "all" or "any" conditions in rules - [`7d23059`](https://github.com/actualbudget/actual/commit/7d23059f5c5fa7616bd8816070ed1d45755cf9bb) Update tests - [`d4ccf6c`](https://github.com/actualbudget/actual/commit/d4ccf6c486214fbe3fd08b327fc5a8e161e51528) Fix language nit - [`4b9eeec`](https://github.com/actualbudget/actual/commit/4b9eeec14488dfac35f250eb53589e3fad66b182) Rename db column conditions_op - [`11836ee`](https://github.com/actualbudget/actual/commit/11836ee80580072da237dd94eb10262fdf61d5ce) Use array includes - [`cd4de7b`](https://github.com/actualbudget/actual/commit/cd4de7bad6284aa0a303e72cca85e291e5589d24) Merge branch 'master' into feature/rule-every-any - [`59baaa9`](https://github.com/actualbudget/actual/commit/59baaa9b9ed6fcafb130bc43e671a3f49b68fac0) Add mapping for conditionsOp <-> conditions_op ### 📊 Changes **18 files changed** (+204 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/e2e/page-models/rules-page.js` (+11 -0) 📝 `packages/desktop-client/e2e/schedules.test.js` (+3 -3) 📝 `packages/desktop-client/public/data-file-index.txt` (+1 -0) ➕ `packages/desktop-client/public/data/migrations/1679728867040_rules_conditions.sql` (+5 -0) 📝 `packages/desktop-client/src/components/ManageRules.js` (+4 -2) 📝 `packages/desktop-client/src/components/modals/EditRule.js` (+33 -5) 📝 `packages/desktop-client/src/components/payees/ManagePayeesWithData.js` (+1 -0) ➕ `packages/loot-core/migrations/1679728867040_rules_conditions.sql` (+5 -0) 📝 `packages/loot-core/src/server/accounts/__snapshots__/transaction-rules.test.js.snap` (+6 -0) 📝 `packages/loot-core/src/server/accounts/rules.js` (+5 -2) 📝 `packages/loot-core/src/server/accounts/rules.test.js` (+54 -3) 📝 `packages/loot-core/src/server/accounts/sync.test.js` (+4 -0) 📝 `packages/loot-core/src/server/accounts/transaction-rules.js` (+32 -15) 📝 `packages/loot-core/src/server/accounts/transaction-rules.test.js` (+27 -1) 📝 `packages/loot-core/src/server/aql/schema/index.js` (+1 -0) 📝 `packages/loot-core/src/server/schedules/app.js` (+2 -0) 📝 `packages/loot-core/src/shared/rules.js` (+4 -0) ➕ `upcoming-release-notes/811.md` (+6 -0) </details> ### 📄 Description This address #685 . I decided to expand the rule model to allow a `conditionsOp` that can either have value `and` or `or` and enables a rule to be matched based on all or any of the provided conditions. This can be seen as a stopgap while you evaluate whenever a much more complex "conditions builder" is worth the effort (IMO not, especially if Actual adds regular expressions matchers). Also have a couple of questions for you: - How do you test the server locally? I have `actual-server` but could not find docs on serving my dev version of `actual` - What's your opinion of the default value? I personally would migrate rules to all have this new field populated but would like to hear your thoughts - Is there anything I have missed that needs to be accounted for? Thank you for your time 🙏 and hope this is appreciated 😊 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 20:55:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#56998