feat(REQ-005): implement TrEx Basic V1 API contract with auth, assets, ledger, and user endpoints

- Add V1 API routes for assets, ledger, and user info with complete CRUD operations
- Implement authentication scopes and request validation via auth_routes.py
- Extend schemas with V1-specific models for accounts, holdings, and positions
- Add database queries and aggregations for P&L, performance, and account data
- Include comprehensive test coverage for all V1 endpoints and integration flows
- Update batch and release documentation with implementation and verification evidence
- Sync project structure and runtime flows per V1 API contract requirements

Closes implementation phase of BAT-001 (TrEx Basic V1 API Contract)
This commit is contained in:
2026-05-02 11:37:42 +00:00
parent ce63c75c9c
commit 3509606c7e
17 changed files with 1159 additions and 124 deletions
+5
View File
@@ -68,6 +68,9 @@ class _BootstrapRepo:
self.closed = True
_TEST_ENC_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
def test_startup_bootstraps_initial_user_when_users_table_empty() -> None:
repo = _BootstrapRepo()
settings = Settings(
@@ -76,6 +79,7 @@ def test_startup_bootstraps_initial_user_when_users_table_empty() -> None:
bootstrap_email="admin@example.com",
bootstrap_password="bootstrap123",
allowed_origins_raw="http://localhost:3000",
credential_encryption_key=_TEST_ENC_KEY,
)
bootstrap_app = create_app(settings_factory=lambda: settings, repository_factory=lambda current: repo)
@@ -99,6 +103,7 @@ def test_startup_does_not_bootstrap_when_users_exist() -> None:
bootstrap_email="admin@example.com",
bootstrap_password="bootstrap123",
allowed_origins_raw="http://localhost:3000",
credential_encryption_key=_TEST_ENC_KEY,
)
bootstrap_app = create_app(settings_factory=lambda: settings, repository_factory=lambda current: repo)