Skip to content

Commit dbec938

Browse files
authored
Support v2 benchmark updates (#17)
1 parent c8c6e8b commit dbec938

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/commands/benchmarks/createBenchmark/BenchmarkRebalanceThresholdStep.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class BenchmarkRebalanceThresholdStep<T extends BenchmarkCreateContext> e
88
context.benchmarkRebalanceThresholdPct = Number((await context.ui.showInputBox({
99
title: this.title,
1010
prompt: l10n.t('Enter benchmark\'s recommended rebalance threshold (%)'),
11+
value: context.benchmark?.rec_rebalance_threshold_pct?.toString(),
1112
validateInput: this.validateInput,
1213
})));
1314
}

src/commands/benchmarks/updateBenchmark/BenchmarkUpdateStep.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class BenchmarkUpdateStep<T extends BenchmarkUpdateContext> extends Execu
2929
name: nonNullProp(context, 'benchmarkName'),
3030
description: context.benchmarkDescription,
3131
asset_allocation: assetAllocation,
32+
rec_rebalance_threshold_pct: context.benchmarkRebalanceThresholdPct,
3233
real_return_pct: context.benchmarkRealReturn,
3334
std_dev_pct: context.benchmarkStdDev,
3435
drawdown_yrs: context.benchmarkDrawdownYears,

src/commands/benchmarks/updateBenchmark/updateBenchmark.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { BenchmarkStdDevStep } from "../createBenchmark/BenchmarkStdDevStep";
1515
import { BenchmarkDrawdownYearsStep } from "../createBenchmark/BenchmarkDrawdownYearsStep";
1616
import { BenchmarkItem } from "../../../tree/benchmarks/BenchmarkItem";
1717
import { BenchmarkUpdateStep } from "./BenchmarkUpdateStep";
18+
import { BenchmarkRebalanceThresholdStep } from "../createBenchmark/BenchmarkRebalanceThresholdStep";
1819

1920
export async function updateBenchmark(context: CommandContext, item: BenchmarkItem): Promise<void> {
2021
const wizardContext: BenchmarkUpdateContext = {
@@ -31,6 +32,7 @@ export async function updateBenchmark(context: CommandContext, item: BenchmarkIt
3132
new BenchmarkDescriptionStep(),
3233
new BenchmarkAssetCategoriesStep(),
3334
new BenchmarkAssetAmountsStep(),
35+
new BenchmarkRebalanceThresholdStep(),
3436
new BenchmarkRealReturnStep(),
3537
new BenchmarkStdDevStep(),
3638
new BenchmarkDrawdownYearsStep(),

0 commit comments

Comments
 (0)