Show stage pill next to profit target on dashboards
State API now returns stage = 1 + number of withdrawals. Both the main dashboard and the account detail page show a small Stage N pill next to the profit target value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
009f7471c2
commit
536aad27ef
@@ -36,6 +36,8 @@ export async function GET() {
|
||||
const isDead = autoLiqThreshold > 0 && cash.amount <= autoLiqThreshold;
|
||||
const allFundTxns = client.fundTransactions?.[acc.id] ?? [];
|
||||
const priorProfit = client.priorProfit?.[acc.id] ?? 0;
|
||||
// Stage = 1 + number of withdrawals (negative fund transactions)
|
||||
const stage = 1 + allFundTxns.filter((f) => f.amount < 0).length;
|
||||
// Hide initial funding (amount === accountSize) from display
|
||||
const displayFundTxns = cfg
|
||||
? allFundTxns.filter((f) => f.amount !== cfg.account_size)
|
||||
@@ -88,6 +90,7 @@ export async function GET() {
|
||||
autoLiqThreshold,
|
||||
totalProfit,
|
||||
targetHit,
|
||||
stage,
|
||||
dailyTarget,
|
||||
effectiveProfitTarget,
|
||||
dailyPnL,
|
||||
|
||||
Reference in New Issue
Block a user