feat: add portfolio item symbol to v1 responses
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
- 비존재 `portfolio_id`는 HTTP 404. ownership 불일치는 HTTP 403.
|
||||
- 이미 `disabled` 상태인 portfolio에 재호출 시 HTTP 200 + 멱등 응답(또는 HTTP 409 — 본 REQ 구현 시 확정).
|
||||
- 응답: HTTP 200 또는 204 + (HTTP 200 시) disabled 상태 portfolio 또는 확정 응답.
|
||||
- HTTP 200 응답을 반환하는 구현에서는 `PortfolioItem.symbol` 도 함께 포함해야 하며, 값은 soft delete 이후에도 linked asset row join 결과와 동일해야 한다.
|
||||
|
||||
## Acceptance Criteria
|
||||
1. Given session token + 본인 active portfolio, When `DELETE /v1/portfolios/{id}`, Then HTTP 200/204 + `portfolios.status='disabled'` + `managed_by_daemon_id IS NULL` 사후 상태.
|
||||
@@ -41,6 +42,7 @@
|
||||
8. Given 비존재 `portfolio_id`, When `DELETE /v1/portfolios/{id}`, Then HTTP 404.
|
||||
9. Given disabled portfolio + admin `PATCH status='enabled'`, When `PATCH`, Then HTTP 200 + 복구. (REQ-026 AC-9와 연계)
|
||||
10. Given AC-1 실행 후 disabled portfolio에 ledger trade/tag/comment write 시도, When 시도, Then 모두 차단(HTTP 409 또는 422). (REQ-029/030/031과 연계 검증)
|
||||
11. Given active asset(`symbol="005930"`)을 참조하던 portfolio, When `DELETE /v1/portfolios/{id}` 가 HTTP 200 응답을 반환, Then 응답의 `PortfolioItem.symbol == "005930"` 이고 값은 joined asset row와 일치한다.
|
||||
|
||||
## Impacted Area
|
||||
- Docs:
|
||||
@@ -62,6 +64,64 @@
|
||||
|
||||
## Change Log
|
||||
|
||||
### CHG-20260524-02
|
||||
- Date: 2026-05-24
|
||||
- Author: Hermes Agent
|
||||
|
||||
#### Change Summary
|
||||
- Status: Approved → Implemented
|
||||
|
||||
#### Intent
|
||||
- BAT-014 verification 완료. DELETE(soft delete) HTTP 200 응답의 `PortfolioItem.symbol` 계약이 코드/테스트/문서에 반영되어 REQ-027 acceptance criteria 전부가 다시 충족되었다.
|
||||
|
||||
#### Acceptance Criteria Delta
|
||||
- No change
|
||||
|
||||
#### Impacted Area Delta
|
||||
- No change
|
||||
|
||||
#### Delivery Trace Delta
|
||||
- Batches: BAT-014 (release-candidate); BAT-009 response-contract evidence superseded by BAT-014
|
||||
- Releases: pending
|
||||
|
||||
#### Revalidation Impact
|
||||
- Reverification Needed: no
|
||||
- Existing Implementation Invalidated: no
|
||||
- Status Recommendation: promote-to-implemented
|
||||
- Follow-up Action: release 단계에서 smoke 확인
|
||||
|
||||
### CHG-20260524-01
|
||||
- Date: 2026-05-24
|
||||
- Author: Hermes Agent
|
||||
|
||||
#### Change Summary
|
||||
- `PortfolioItem.symbol` 응답 계약 추가에 따라 REQ-027 soft delete 응답 contract를 보강하고 상태를 Implemented → Approved로 되돌림.
|
||||
|
||||
#### Intent
|
||||
- trex-orbit 팀 이슈 후속으로, delete/disable 응답에서도 client가 별도 asset lookup 없이 포트폴리오 식별 symbol을 유지할 수 있어야 한다. soft delete는 asset reference를 제거하지 않으므로 HTTP 200 응답이 있는 경우 `symbol`을 함께 반환하는 계약이 자연스럽다.
|
||||
|
||||
#### Acceptance Criteria Delta
|
||||
- Added:
|
||||
- AC-11: DELETE(HTTP 200) 응답의 `PortfolioItem.symbol` 이 joined `assets.symbol` 과 일치해야 함
|
||||
|
||||
#### Impacted Area Delta
|
||||
- Docs: `docs/interface-contract.md` 의 DELETE `/v1/portfolios/{id}` 응답 예시에 `symbol` 추가 필요 (REQ-032 후속)
|
||||
- Modules: `app/schemas/v1.py`, `app/api/v1_portfolios.py` (`_portfolio_to_item`)
|
||||
- Tests: `tests/test_v1_portfolios_crud.py` 에 DELETE 200 응답 `symbol` 검증 추가 필요
|
||||
|
||||
#### Delivery Trace Delta
|
||||
- Batches: BAT-009 evidence partially superseded; follow-up BAT-014 예정
|
||||
- Releases: REL-001 response-contract evidence 일부 재검토 필요
|
||||
|
||||
#### Revalidation Impact
|
||||
- Reverification Needed: yes
|
||||
- Existing Implementation Invalidated: yes (response schema evidence partial)
|
||||
- Status Recommendation: revert-to-approved
|
||||
- Follow-up Action: BAT-014에서 DELETE 응답 contract 회귀 검증 추가
|
||||
|
||||
#### Validation Plan
|
||||
- `tests/test_v1_portfolios_crud.py` 에서 DELETE 200 응답 body의 `symbol` 존재 및 joined asset symbol 일치 여부를 검증한다.
|
||||
|
||||
### CHG-20260521-01
|
||||
- Date: 2026-05-21
|
||||
- Author: Justin Ko
|
||||
|
||||
Reference in New Issue
Block a user