feat(REQ-001): add portfolio comment history API, CLI, repository, migration, and tests
Agent-Logs-Url: https://github.com/genichin/portfolio-hub/sessions/64fc2cec-78f5-41d1-99a4-45f868781edd Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
4684597353
commit
e8f782bec6
@@ -217,6 +217,36 @@ Base routes:
|
||||
- `keep_ledger` (bool, default `false`)
|
||||
- Response `204`: no content
|
||||
|
||||
#### Create Comment
|
||||
|
||||
- `POST /portfolios/{portfolio_id}/comments`
|
||||
- Auth: `trade-write`
|
||||
- Body: `CommentCreateRequest` (`content: str`)
|
||||
- Response `201`: `CommentResponse`
|
||||
- Response `404`: portfolio not found
|
||||
|
||||
#### List Comments
|
||||
|
||||
- `GET /portfolios/{portfolio_id}/comments`
|
||||
- Auth: `read`
|
||||
- Response `200`: array of `CommentResponse`, sorted by `created_at DESC`
|
||||
- Response `404`: portfolio not found
|
||||
|
||||
#### Update Comment
|
||||
|
||||
- `PATCH /portfolios/{portfolio_id}/comments/{comment_id}`
|
||||
- Auth: `trade-write`
|
||||
- Body: `CommentUpdateRequest` (`content: str`)
|
||||
- Response `200`: `CommentResponse`
|
||||
- Response `404`: portfolio or comment not found
|
||||
|
||||
#### Delete Comment
|
||||
|
||||
- `DELETE /portfolios/{portfolio_id}/comments/{comment_id}`
|
||||
- Auth: `trade-write`
|
||||
- Response `204`: no content
|
||||
- Response `404`: portfolio or comment not found
|
||||
|
||||
### 7.3 Strategy Set Endpoints
|
||||
|
||||
#### List Strategy Sets
|
||||
@@ -473,6 +503,14 @@ Bootstrap rule:
|
||||
|
||||
- `infer_symbol: str | null`
|
||||
|
||||
`CommentCreateRequest`
|
||||
|
||||
- `content: str`
|
||||
|
||||
`CommentUpdateRequest`
|
||||
|
||||
- `content: str`
|
||||
|
||||
`CreateStrategySetRequest`
|
||||
|
||||
- `name: str`
|
||||
@@ -529,6 +567,14 @@ Bootstrap rule:
|
||||
|
||||
- `detail: str`
|
||||
|
||||
`CommentResponse`
|
||||
|
||||
- `id: str`
|
||||
- `portfolio_id: str`
|
||||
- `content: str`
|
||||
- `created_at: datetime | null`
|
||||
- `updated_at: datetime | null`
|
||||
|
||||
`BotPrincipalResponse`
|
||||
|
||||
- `id: str`
|
||||
@@ -565,6 +611,13 @@ Portfolio subcommands:
|
||||
- `portfoliohub portfolio reset <portfolio_id> [--infer-symbol ...] [--force]`
|
||||
- `portfoliohub portfolio delete <portfolio_id> [--keep-ledger] [--force]`
|
||||
|
||||
Portfolio comment subcommands:
|
||||
|
||||
- `portfoliohub portfolio comment add <portfolio_id> --content <text>`
|
||||
- `portfoliohub portfolio comment list <portfolio_id>`
|
||||
- `portfoliohub portfolio comment update <portfolio_id> <comment_id> --content <text> [--force]`
|
||||
- `portfoliohub portfolio comment delete <portfolio_id> <comment_id> [--force]`
|
||||
|
||||
Strategy subcommands:
|
||||
|
||||
- `portfoliohub strategy list`
|
||||
|
||||
Reference in New Issue
Block a user