feat: add portfolio ownership model, auth guards, and migration

This commit is contained in:
2026-04-14 00:13:34 +09:00
parent e89690b1dd
commit 9787cf3159
22 changed files with 681 additions and 70 deletions
+9 -1
View File
@@ -91,6 +91,7 @@ class PortfolioRepository(Protocol):
status: str = "enabled",
active_strategy_id: str | None = None,
avabile_strategies: list[str] | None = None,
owner_user_id: str | None = None,
initial_cash: float = 0.0,
) -> Portfolio: ...
@@ -98,6 +99,7 @@ class PortfolioRepository(Protocol):
self,
portfolio_id: str,
*,
owner_user_id: str,
broker: str,
status: str,
name: str,
@@ -112,7 +114,13 @@ class PortfolioRepository(Protocol):
def update_portfolio(self, portfolio_id: str, **fields: object) -> Portfolio: ...
def list_portfolios(self, *, broker: str | None = None, status: str | None = None) -> list[Portfolio]: ...
def list_portfolios(
self,
*,
broker: str | None = None,
status: str | None = None,
owner_user_id: str | None = None,
) -> list[Portfolio]: ...
def get_or_create_strategy_set(self, name: str, config: str) -> StrategySet: ...