clean up capture daily change command
This commit is contained in:
@@ -49,16 +49,9 @@ class CaptureDailyChange extends Command
|
|||||||
->portfolio($portfolio->id)
|
->portfolio($portfolio->id)
|
||||||
->getPortfolioMetrics(config('investbrain.base_currency'));
|
->getPortfolioMetrics(config('investbrain.base_currency'));
|
||||||
|
|
||||||
$total_cost_basis = $metrics->get('total_cost_basis');
|
|
||||||
$total_market_value = $metrics->get('total_market_value');
|
|
||||||
|
|
||||||
$portfolio->daily_change()->create([
|
$portfolio->daily_change()->create([
|
||||||
'date' => now(),
|
'date' => now(),
|
||||||
'total_market_value' => $total_market_value,
|
'total_market_value' => $metrics->get('total_market_value'),
|
||||||
'total_cost_basis' => $total_cost_basis,
|
|
||||||
'total_market_gain' => $total_market_value - $total_cost_basis,
|
|
||||||
'total_dividends_earned' => $metrics->get('total_dividends_earned'),
|
|
||||||
'realized_gains' => $metrics->get('realized_gain_dollars'),
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user