chore:clean up ai helper methods
This commit is contained in:
@@ -238,4 +238,19 @@ class Portfolio extends Model
|
||||
return $close;
|
||||
}
|
||||
|
||||
public function getFormattedHoldings()
|
||||
{
|
||||
$formattedHoldings = '';
|
||||
foreach($this->holdings as $holding) {
|
||||
$formattedHoldings .= " * Holding of ".$holding->market_data->name." (".$holding->symbol.")"
|
||||
."; with ". ($holding->quantity > 0 ? $holding->quantity : 'ZERO') . " shares"
|
||||
."; avg cost basis ". $holding->average_cost_basis
|
||||
."; curr market value ". $holding->market_data->market_value
|
||||
."; unrealized gains ". $holding->market_gain_dollars
|
||||
."; realized gains ". $holding->realized_gain_dollars
|
||||
."; dividends earned ". $holding->dividends_earned
|
||||
."\n\n";
|
||||
}
|
||||
return $formattedHoldings;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user