- Complete MVP for tracking Fidelity brokerage account performance - Transaction import from CSV with deduplication - Automatic FIFO position tracking with options support - Real-time P&L calculations with market data caching - Dashboard with timeframe filtering (30/90/180 days, 1 year, YTD, all time) - Docker-based deployment with PostgreSQL backend - React/TypeScript frontend with TailwindCSS - FastAPI backend with SQLAlchemy ORM Features: - Multi-account support - Import via CSV upload or filesystem - Open and closed position tracking - Balance history charting - Performance analytics and metrics - Top trades analysis - Responsive UI design Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""Pydantic schemas for account-related API operations."""
|
|
from pydantic import BaseModel, Field
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from app.models.account import AccountType
|
|
|
|
|
|
class AccountBase(BaseModel):
|
|
"""Base schema for account data."""
|
|
account_number: str = Field(..., description="Unique account identifier")
|
|
account_name: str = Field(..., description="Human-readable account name")
|
|
account_type: AccountType = Field(default=AccountType.CASH, description="Account type")
|
|
|
|
|
|
class AccountCreate(AccountBase):
|
|
"""Schema for creating a new account."""
|
|
pass
|
|
|
|
|
|
class AccountUpdate(BaseModel):
|
|
"""Schema for updating an existing account."""
|
|
account_name: Optional[str] = Field(None, description="Updated account name")
|
|
account_type: Optional[AccountType] = Field(None, description="Updated account type")
|
|
|
|
|
|
class AccountResponse(AccountBase):
|
|
"""Schema for account API responses."""
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|