Repository navigation
[AI] docs(api): drop the orphaned Payee Rule type - #8698
Conversation
getPayeeRules returns ordinary Rule objects: packages/loot-core/src/server/payees/app.ts
returns rules.getRulesForPayee(id).map(rule => rule.serialize()), and Rule.serialize()
emits exactly { id, stage, conditionsOp, conditions, actions }. There is no payee_id on
the returned objects, and no API method accepts or returns a payeeRule, so the type was
documentation-only. The reference already annotates getPayeeRules as Promise<Rule[]>.
Remove the Payee rule entry from the Rules APIList too, since its anchor pointed at the
deleted heading, and explain the payee association under getPayeeRules instead: it is
carried by a condition or action on the payee field rather than by a column.
Closes actualbudget#8697
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hello contributor! We would love to review your PR! Before we can do that, please make sure:
A quick note on volume: please get one PR reviewed and merged before opening several more. A stack of simultaneous, similar PRs from one author is reviewed slowly, and low-effort, untested, or undisclosed-AI PRs may be closed without a detailed review. We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges. For more information, please see our Contributing Guide. |
✅ Deploy Preview for actualbudget-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe Rules API documentation removes the obsolete ChangesRules API documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thanks to you matt-fidd and the team for the work you have been doing! |
getPayeeRules returns ordinary Rule objects: packages/loot-core/src/server/payees/app.ts
returns rules.getRulesForPayee(id).map(rule => rule.serialize()), and Rule.serialize()
emits exactly { id, stage, conditionsOp, conditions, actions }. There is no payee_id on
the returned objects, and no API method accepts or returns a payeeRule, so the type was
documentation-only. The reference already annotates getPayeeRules as Promise<Rule[]>.
Remove the Payee rule entry from the Rules APIList too, since its anchor pointed at the
deleted heading, and explain the payee association under getPayeeRules instead: it is
carried by a condition or action on the payee field rather than by a column.
Closes actualbudget#8697
Description
The API reference documented a
Payee Ruletype with a requiredpayee_idfield. No API method returns an object with that field, and none accepts apayeeRule, so the type was documentation-only.getPayeeRulesreturns ordinary serializedRuleobjects:packages/loot-core/src/server/payees/app.tsreturnsrules.getRulesForPayee(id).map(rule => rule.serialize())typed asPromise<RuleEntity[]>, andRule.serialize()emits exactly{ id, stage, conditionsOp, conditions, actions }. The reference already agreed, annotatinggetPayeeRulesasreturns="Promise<Rule[]>"two lines below that struct.This PR:
payeeRuleentry fromtypes.jsxand the#### Payee Rulesection fromreference.md"Payee rule"from the RulesAPIList, whose#payee-ruleanchor would otherwise point at a deleted headinggetPayeeRulesinstead: a rule belongs to a payee when one of its conditions or actions has apayeefield referencing that id, so there is nopayee_idon the returned rulesContext on why this matters in practice: I maintain an MCP server on top of
@actual-app/apiand implemented the payee-rules lookup with arule.payee_id === payeeIdfilter taken from this table. The field does not exist, so the filter matched nothing and the tool returned an empty list for every payee for months.Researched and drafted with Claude Code; the diff was reviewed and verified by me.
Related issue(s)
Closes #8697
Related to #8682, which reports the wrong
stagevalue list on the siblingRuletable. Kept separate deliberately so a one-line wording fix does not wait on this one. The two touch different blocks oftypes.jsxand merge in either order.Testing
Docs-only change, verified on this PR's Netlify deploy preview (https://deploy-preview-8698.www.actualbudget.org/docs/api/reference/):
Payee Ruleheading and struct table are gone#payee-rulelinkgetPayeeRulesparagraph renders correctlyAlso confirmed there are no remaining references to
objects.payeeRuleanywhere in the repo, and thatoxfmt --check packages/docs/docs/api/types.jsxpasses against.oxfmtrc.json.Checklist
packages/docs/, whichrelease-notes.ymlexempts viaonly_docs.check-release-notespasses.