feat(REQ-014): add portfolio-create-user-required requirement and implementation

- Add docs/srs/Interface/req-014_portfolio-create-user-required.md with acceptance criteria
- Create docs/batches/bat-004_20260502_portfolio-create-user-required/ delivery batch
- Enhance app/cli/commands/portfolio.py: validate user_id parameter before portfolio creation
- Add comprehensive CLI tests in tests/test_cli.py for portfolio create validation flows
- Update docs/batches/index.md and docs/srs/index.md with new requirement/batch references
- Update README.md documentation
This commit is contained in:
2026-05-02 13:45:46 +00:00
parent 2f686f79ce
commit a111fdd83f
10 changed files with 368 additions and 16 deletions
@@ -0,0 +1,42 @@
# BAT-004 Index
- Status: release-candidate
- Batch: BAT-004
- Profile: batch-lite
- Created: 2026-05-02
## Included REQ
| REQ | 제목 | Type | Priority |
|-----|------|------|----------|
| REQ-014 | CLI `portfolio create --user` 필수화 및 소유자 설정 | Interface | Medium |
## Source Discovery
- minor-change fast path (Discovery 없음)
## Scope Summary
- CLI `pfhub portfolio create` 명령에 `--user <username>` 필수 옵션 추가
- `_with_service_and_repo` 헬퍼(REQ-013 도입) 재사용, `repository.get_user_by_username(user)` 호출
- `PortfolioService.create_portfolio(owner_user_id=owner.id, ...)` 실제 UUID 전달
- `--user` 미입력 시 exit code 1, 미존재 username 시 exit code 1
- README 예제 갱신
- DB 스키마 변경 없음, HTTP API 변경 없음
## Impacted Area
- Docs:
- `README.md` — `pfhub portfolio create` 예제 라인 `--user <username>` 추가
- Modules:
- `app/cli/commands/portfolio.py` — `create_portfolio` 명령 수정
- Tests:
- `tests/test_cli.py` — 기존 `test_cli_create_buy_and_delete_flow` 수정 + AC 1~4 커버 케이스 추가
## Stage Documents
| Stage | File | Status |
|-------|------|--------|
| Planning | [planning.md](./planning.md) | confirmed |
| Implementation | [implementation.md](./implementation.md) | completed |
| Verification | [verification.md](./verification.md) | verified |