Repository navigation
[Due for payment 2026-10-16] [Rules Engine Release 2] [App] Use the new SetRule and DeleteRule commands #102275
Copy link
Copy link
Open
Labels
ReviewingHas a PR in reviewHas a PR in reviewSkip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.Skips all the payment process steps for an issue. Use it for fixed-price projects.WeeklyKSv2KSv2
Description
Now that #102273 is complete and every user is using the latest version of the app, lets start using the SetRule and DeleteRule commands
Data storage
- Each rule has the following structure:
{
// For merchant rules, lets hard code this to 'policy'
"scope": "policy" | "account",
"scopeID": "<relevant ID based on the scope, so either the policyID, accountID, or domainAccountID>"
// The triggers for a rule are when the relevant rules run. There must always be 1 trigger, but there can be more. For now, lets just worry
// about CreateTransaction
"triggers": {
"0": "CreateTransaction",
},
// Filters follow the exact same AST format as search. They are infinitely extendable, however, for merchant rules, all we care about right now
// is the 'merchant' filter
"filters": {
"left": {
"left": "merchant",
"operator": "eq" | "neq" | "contains" | "notContains" | "gt" | "gte" | "lt" | "lte",
"right": ["Hello world"],
}
"operator": "and"
"right": {
"left": "category",
"operator": "eq" | "neq" | "contains" | "notContains" | "gt" | "gte" | "lt" | "lte",
"right": ["Hello world"],
},
// The actions that are taken on any expenses that match the filters object above
"actions": {
"0": { "name": "Set", "field": "billable", "value": true},
"1": { "name": "Set", "field": "merchant", "value": "modified merchant"},
"2": { "name": "Set", "field": "category", "value": "category"},
"3": { "name": "Set", "field": "tag", "value": "tag"},
"4": { "name": "Set", "field": "reimbursable", "value": true},
"5": { "name": "Set", "field": "vendorID", "value": "vendorid"},
"6": { "name": "Set", "field": "comment", "value": "mycomment"},
"7": { "name": "Set", "field": "tax", "value": { "field_id_TAX": {"externalID": "taxCode"}}},
}
}When a user creates a merchant rule, we should modify the filters to meet the request of the user, and we should modify the actions to include the fields the user wants to set. The triggers should always be just CreateTransaction for now
API Commands
SetRule - Sets a new rule in the database
Params
scope- The scope of the rule. For merchant rules, this should bepolicyscopeID- The ID for the scope of the rule. For merchant rules, this should be the policyIDruleID- A randomrand64()value for the ID of the rulepriority- This determines which order the rules should apply in. For expense defaults, lets hard code this to10000value- The value of the rule. This will be an object that looks like:
{
"filters": // ...
"triggers": //...
"actions": // ...
}
DeleteRule - Deletes a rule in the database
Params
ruleID- The ID of the rule
Issue Owner
Current Issue Owner: @Krishna2323Reactions are currently unavailable
Metadata
Metadata
Labels
ReviewingHas a PR in reviewHas a PR in reviewSkip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.Skips all the payment process steps for an issue. Use it for fixed-price projects.WeeklyKSv2KSv2
Activity
melvin-bot commentedon Sep 28, 2026
@Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Sep 30, 2026
@Krishna2323 Eep! 4 days overdue now. Issues have feelings too...
[-][Rules Engine Release 1] Use the new SetRule and DeleteRule commands[/-][+][Rules Engine Release 2] Use the new SetRule and DeleteRule commands[/+][-][Rules Engine Release 2] Use the new SetRule and DeleteRule commands[/-][+][Rules Engine Release 2] [App] Use the new SetRule and DeleteRule commands[/+]melvin-bot commentedon Oct 2, 2026
@Krishna2323 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Oct 3, 2026
@Krishna2323 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Oct 6, 2026
@Krishna2323 10 days overdue. Is anyone even seeing these? Hello?
6 remaining items
melvin-bot commentedon Oct 9, 2026
@Krishna2323 / @situchan
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.6-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-10-16. 🎊
JS00001 commentedon Oct 12, 2026
We are going to need to re-create this PR since it was reverted. Note, it was not a regression, so there should be no penalty
melvin-bot commentedon Oct 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)Krishna2323 commentedon Oct 13, 2026
@luacmartins, payments for the Rules Engine project will be handled centrally, so we should remove the
Awaiting Paymentlabel.luacmartins commentedon Oct 13, 2026
Ok, removed