feat(req-002): implement portfolio tagging and tag filters

This commit is contained in:
2026-04-14 01:06:10 +09:00
parent 2dab17cbb1
commit a776ea3b1d
20 changed files with 1033 additions and 32 deletions
+23
View File
@@ -35,6 +35,29 @@ class FakeRepo:
def list_recent_trades(self, portfolio_id: str, limit: int = 5) -> list[LedgerEntry]:
return []
def list_portfolios(
self,
*,
broker: str | None = None,
status: str | None = None,
owner_user_id: str | None = None,
include_tags: list[str] | None = None,
exclude_tags: list[str] | None = None,
match_mode: str | None = None,
):
if owner_user_id is not None and self._portfolio.owner_user_id != owner_user_id:
return []
return [self._portfolio]
def add_tag(self, portfolio_id: str, *, tag: str):
raise NotImplementedError()
def list_tags(self, portfolio_id: str):
return []
def remove_tag(self, portfolio_id: str, *, tag: str) -> None:
raise NotImplementedError()
def get_strategy_set(self, id: str):
if id == self._strategy.id:
return self._strategy