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
+15
View File
@@ -70,6 +70,21 @@ class IssuedServiceToken(BaseModel):
auth_token: AuthTokenResponse
class IssueServiceTokenRequest(BaseModel):
name: str = Field(min_length=1)
username: str = Field(min_length=1)
permission: Literal["read", "trade-write", "admin"] = "read"
expires_in_days: int | None = Field(default=None, ge=1, le=3650)
no_expiry: bool = False
class IssueServiceTokenApiResponse(BaseModel):
token: str
token_type: Literal["bearer"] = "bearer"
runtime_id: str | None = None
auth_token: AuthTokenResponse
class ServiceTokenIssueCliResponse(BaseModel):
token_id: str
name: str