feat: REQ-028 add display_name to GET /v1/portfolios response

- Portfolio domain model + PortfolioItem schema에 display_name 필드 추가
- _SELECT_PORTFOLIO에 a.display_name JOIN 보강, _portfolio_to_item 매퍼 전달
- REQ-028 CHG-20260601-01/02: Implemented → Approved → Implemented
  - AC-13 신설 (display_name == joined assets.display_name)
- BAT-009 verification.md: AC-13 매핑 + augmentation history 누적
- REL-001 verification checklist 재실행 evidence 갱신 (368 PASSED, 로컬 smoke 5건 통과)
- tests/test_v1.py: dead 중복 GET /v1/assets 섹션 제거 (두 번째 동명 정의가 첫 번째를 override하던 잔재)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 14:00:59 +00:00
co-authored by Claude Opus 4.7
parent 136ae16885
commit 84de34c301
10 changed files with 112 additions and 151 deletions
+1
View File
@@ -55,6 +55,7 @@ def _portfolio_to_item(portfolio: Portfolio) -> PortfolioItem:
portfolio_id=portfolio.portfolio_id,
asset_id=portfolio.asset_id,
symbol=portfolio.symbol,
display_name=portfolio.display_name,
owner_user_id=portfolio.owner_user_id,
broker=portfolio.broker,
status=portfolio.status,
+1
View File
@@ -107,6 +107,7 @@ class Portfolio:
name: str
symbol: str
asset_id: str | None = None
display_name: str | None = None
tags: list[str] | None = None
tag_ids: list[str] | None = None
owner_user_id: str | None = None
+3 -1
View File
@@ -63,7 +63,8 @@ _SELECT_PORTFOLIO = """
p.last_trade_at,
p.managed_by_daemon_id,
p.asset_id,
COALESCE(p.tag_ids, '{}'::uuid[])
COALESCE(p.tag_ids, '{}'::uuid[]),
a.display_name
FROM portfolios p
JOIN assets a ON p.asset_id = a.asset_id
"""
@@ -444,6 +445,7 @@ class PostgresPortfolioRepository:
managed_by_daemon_id=row[15] if len(row) > 15 else None,
asset_id=str(row[16]) if len(row) > 16 and row[16] is not None else None,
tag_ids=[str(t) for t in row[17]] if len(row) > 17 and row[17] is not None else [],
display_name=row[18] if len(row) > 18 else None,
)
@staticmethod
+1
View File
@@ -166,6 +166,7 @@ class PortfolioItem(BaseModel):
portfolio_id: str
asset_id: str | None = None
symbol: str | None = None
display_name: str | None = None
owner_user_id: str | None = None
broker: str
status: str