feat(BAT-005): add broker credential CLI command with persistence and tests

- Add CredentialService for managing broker credentials
- Implement credential CLI commands (create, list, get, update, delete)
- Add postgres repository support for credential operations
- Add comprehensive test coverage for credential CLI
- Update docs/batches/index.md and docs/srs/index.md with BAT-005
- Update docs/project-structure.md to reflect credential service
This commit is contained in:
2026-05-03 12:44:40 +00:00
parent fb555dd72e
commit 222c66bb7f
12 changed files with 670 additions and 4 deletions
+11
View File
@@ -1398,6 +1398,17 @@ class PostgresPortfolioRepository:
row = cur.fetchone()
return self._row_to_broker_credential(row)
def delete_broker_credential(self, user_id: str, broker: str) -> bool:
with self._connect().cursor() as cur:
cur.execute(
"""
DELETE FROM broker_credentials
WHERE user_id = %s AND broker = %s
""",
(user_id, broker),
)
return cur.rowcount > 0
# ------------------------------------------------------------------
# Ledger trades
# ------------------------------------------------------------------