feat: REQ-005 assets table tag apply/remove SQL alignment (BAT-013)

- REQ-005 CHG-20260521-02 follow-up: clarify AC-1/AC-5 to target assets table
- Add append_asset_tag_id/remove_asset_tag_id on PostgresPortfolioRepository
- Replace internal calls in apply_asset_tag/remove_asset_tag routes (HTTP contract unchanged)
- 7 new regression tests: method existence, SQL target table, error branches, idempotency guard
- Update existing AC-1/AC-5 assertions to verify new methods + portfolios methods uncalled
- Documentation: runtime-flows.md flow body + change log; rel-001 includes BAT-013
- REQ-005 transition: Approved → Implemented (CHG-20260521-03) via BAT-013 verification
- Total tests: 362 → 369 passed

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 00:04:33 +09:00
co-authored by Claude Opus 4.7
parent 9038f41010
commit 58899b1a94
15 changed files with 509 additions and 17 deletions
+2 -2
View File
@@ -172,7 +172,7 @@ def apply_asset_tag(
if not tag.is_active:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="비활성화된 태그는 적용할 수 없습니다")
repo.append_portfolio_tag_id(asset_id, body.tag_id)
repo.append_asset_tag_id(asset_id, body.tag_id)
except HTTPException:
raise
except ValueError as exc:
@@ -197,7 +197,7 @@ def remove_asset_tag(
repo.get(asset_id)
except ValueError:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"asset을 찾을 수 없습니다: {asset_id}")
repo.remove_portfolio_tag_id(asset_id, tag_id)
repo.remove_asset_tag_id(asset_id, tag_id)
except HTTPException:
raise
except ValueError as exc: