feat: add portfolio daemon assignment and improve list rendering
- Add --daemon-id option to portfolio update command for daemon assignment - Update managed_by_daemon_id field in portfolio updates - Refactor print_portfolio_table() to print_portfolio_list() for better readability - Display daemon_id in portfolio list output when assigned - Show portfolio tags and managed daemon information in CLI list view - Add daemon_id support to portfolio repository and service layers - Update schemas to include managed_by_daemon_id field in responses
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from fastapi import Depends
|
||||
|
||||
@@ -59,6 +60,7 @@ def _to_portfolio_summary(portfolio: Portfolio):
|
||||
profit_buffer=portfolio.profit_buffer,
|
||||
active_strategy_id=portfolio.active_strategy_id,
|
||||
avabile_strategies=portfolio.avabile_strategies,
|
||||
managed_by_daemon_id=portfolio.managed_by_daemon_id,
|
||||
created_at=portfolio.created_at,
|
||||
updated_at=portfolio.updated_at,
|
||||
last_trade_at=portfolio.last_trade_at,
|
||||
@@ -214,7 +216,8 @@ class PortfolioService:
|
||||
active_strategy_id = strategy_set.id
|
||||
avabile_strategies = _merge_strategy_ids(active_strategy_id, payload.avabile_strategies)
|
||||
portfolio = self._repository.create_portfolio(
|
||||
payload.name,
|
||||
str(uuid.uuid4()),
|
||||
name=payload.name,
|
||||
owner_user_id=owner_user_id,
|
||||
broker=payload.broker,
|
||||
status=payload.status,
|
||||
|
||||
Reference in New Issue
Block a user