Repository navigation
feat(auto-invest): configuration panel in investor settings (#476) - #488
Open
solomonadzape95 wants to merge 1 commit into
Open
solomonadzape95 wants to merge 1 commit into
solomonadzape95 wants to merge 1 commit into
Conversation
|
@solomonadzape95 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…gs (StellarState#476) - Add auto-invest rule domain: sectors, min yield, max invoice age, per-invoice cap with validation (lib/autoInvest.ts) - Wire set_auto_invest_rule / disable_auto_invest / AutoInvestExecuted events through lib/api and useAutoInvest - Build AutoInvestSettingsPanel with top enable/disable toggle and confirmation modal on disable - Show the active rule summary and a recent AutoInvestExecuted activity list - Mount the panel in investor settings and link it from the investor dashboard - Cover validation, optimistic save/disable rollback and panel states with tests
solomonadzape95
force-pushed
the
feature/476-auto-invest-settings
branch
from
October 18, 2026 10:07
7175147 to
125be40
Compare
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.
Summary
Implements #476 — an auto-invest configuration panel in investor settings where the investor sets the sectors, minimum yield, maximum invoice age, and per-invoice cap for automatic investing. The top toggle enables/disables with a confirmation step, rules are saved with
set_auto_invest_rule, and recentAutoInvestExecutedevents are listed underneath.Changes
lib/autoInvest.ts) — sector catalogue, default rule, draft → rule validation (required sectors, 0–100% yield, integer day age, positive amount), and wire mapping. Validation is what blocks a save with empty required fields.lib/api/index.ts,hooks/useAutoInvest.ts) —fetchAutoInvestRule,setAutoInvestRule,disableAutoInvest, andfetchAutoInvestExecutedEvents, exposed throughuseAutoInvestwith optimistic save/disable and rollback on failure.components/investor/AutoInvestSettingsPanel.tsx) — sector multi-select chips, min yield, max invoice age, max amount per invoice; enable/disable switch at the top; inline validation errors.components/investor/DisableAutoInvestDialog.tsx) — two-step confirmation before pulling thedisable_auto_investkill switch.components/investor/AutoInvestRuleSummary.tsx) — active configuration card, shown whenever a rule exists.components/investor/AutoInvestActivityList.tsx) — latestAutoInvestExecutedevents with amount, yield, and sector./settings#auto-invest) and linked from the investor dashboard.Acceptance criteria
disable_auto_investwith confirmationAutoInvestExecutedeventsTesting
New coverage (27 tests):
lib/__tests__/autoInvest.test.ts— validation of every required field, sector filtering, draft round-trip, wire mappinghooks/__tests__/useAutoInvest.test.tsx— registry read, optimistic save/disable, rollback + toast on contract failure, disconnected no-fetchcomponents/investor/__tests__/AutoInvestRuleSummary.test.tsx— active/disabled summary valuescomponents/investor/__tests__/AutoInvestActivityList.test.tsx— event rows and empty statecomponents/investor/__tests__/AutoInvestSettingsPanel.test.tsx— empty-field blocking, parse + submit, summary vs form, disable confirmation, re-enable, activity, disconnectedTargeted run:
npx vitest run lib/__tests__/autoInvest.test.ts hooks/__tests__/useAutoInvest.test.tsx components/investor/__tests__/AutoInvest*.test.tsx→ 27 passed.Merge safety
This branch is cut from
devand intentionally touches onlylib/api/index.ts,components/dashboard/InvestorDashboard.tsx, and the settings page among files shared with #474/#475 — and only in disjoint regions (the auto-invest API block is appended at the end oflib/api; the KYC/watchlist blocks are earlier). I verified a local merge of#474 → #475 → #476in order: no conflicts, and the combined feature suites (84 tests) all pass.Closes #476