Repository navigation
[Rules Engine Release 1] Use the new SetRule and DeleteRule commands #102106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JS00001
merged 10 commits into
Expensify:main
from
Krishna2323:krishna2323/rules-engine-setrule
Oct 8, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
17e001a
Write merchant rules through SetRule instead of SetPolicyCodingRule
Krishna2323 fe82b34
Merge branch 'krishna2323/issue-100300' into krishna2323/rules-engine…
Krishna2323 42ce1fd
Merge upstream/main into krishna2323/rules-engine-setrule
Krishna2323 98d7ea1
Fix leaked mockFetch pause stalling the rules test queue
Krishna2323 4ba236b
Defer the SetRule and DeleteRule switch to the 102275 PR
Krishna2323 b59fe24
Write merchant rules through SetRule instead of SetPolicyCodingRule
Krishna2323 5b9b710
Coerce numbers and booleans when asserting FormData request params
Krishna2323 c57eb37
Merge remote-tracking branch 'upstream/main' into krishna2323/rules-e…
Krishna2323 5a9de62
Broaden SetRule/DeleteRule actions beyond merchant rules
Krishna2323 d79e3fa
Merge branch 'Expensify:main' into krishna2323/rules-engine-setrule
Krishna2323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| type DeleteRuleParams = { | ||
| /** The ID of the rule to delete */ | ||
| ruleID: string; | ||
| }; | ||
|
|
||
| export default DeleteRuleParams; |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import type CONST from '@src/CONST'; | ||
|
|
||
| import type {ValueOf} from 'type-fest'; | ||
|
|
||
| type SetRuleParams = { | ||
| /** What kind of entity the rule is scoped to. Merchant rules are always scoped to a policy */ | ||
| scope: ValueOf<typeof CONST.RULES.SCOPE>; | ||
|
|
||
| /** The ID of the scoped entity, i.e. the policyID for policy-scoped rules */ | ||
| scopeID: string; | ||
|
|
||
| /** The ID of the rule being written. A new rule uses an optimistic `rand64()` value */ | ||
| ruleID: string; | ||
|
|
||
| /** Determines the order rules are applied in when more than one matches */ | ||
| priority: number; | ||
|
|
||
| /** | ||
| * The rule body, as a stringified `RuleValue`. It stays a string because the request is sent as | ||
| * `FormData`, which can only carry strings. | ||
| */ | ||
| value: string; | ||
|
|
||
| /** Whether to apply the rule to the transactions that already match it */ | ||
| shouldUpdateMatchingTransactions: boolean; | ||
| }; | ||
|
|
||
| export default SetRuleParams; | ||
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,3 +38,4 @@ type Rule = OnyxValueWithOfflineFeedback< | |
| >; | ||
|
|
||
| export default Rule; | ||
| export type {RuleBody}; | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.