feat: account-scoped category & name rules (#20)#84
Draft
MarkIannucci wants to merge 2 commits into
Draft
Conversation
Add an optional account_id to category_rules and name_rules. When set, a rule only fires for transactions on that account; rules with account_id NULL remain global fallbacks. Account-scoped rules take precedence over global rules at the same priority level, achieved via a per-call account filter plus ORDER BY priority DESC, (account_id IS NULL) ASC, id ASC. accountId is threaded through every call site (sync, CSV import, applyCategoriesToAll, rebuildDisplayNames, seedRules, single-shot categorize/applyNameRules). CSV import now also passes amount so amount-filtered rules behave consistently with Plaid sync. - TUI/GUI Rules screens: account picker in both rule forms + scope badge - MCP add_rule/add_name_rule accept account_id; list_rules surfaces scope - deleteAccount removes that account's scoped rules - Tests cover precedence, scoping, CRUD dedupe, deletion, CSV import Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional account_id to category_rules and name_rules. When set, a rule only fires for transactions on that account; rules with account_id NULL remain global fallbacks. Account-scoped rules take precedence over global rules at the same priority level, achieved via a per-call account filter plus ORDER BY priority DESC, (account_id IS NULL) ASC, id ASC.
accountId is threaded through every call site (sync, CSV import, applyCategoriesToAll, rebuildDisplayNames, seedRules, single-shot categorize/applyNameRules). CSV import now also passes amount so amount-filtered rules behave consistently with Plaid sync.
Closes #20