Initial commit: Wallet App - FastAPI backend with React frontend for personal finance tracking

This commit is contained in:
RemTools
2026-09-04 08:37:14 +00:00 Unverified
commit d7b52f24d2
39572 changed files with 1617122 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
"""Pydantic schemas for request/response validation."""
from datetime import datetime
from pydantic import BaseModel
from typing import Optional
from enum import Enum
class EntryType(str, Enum):
"""Type of wallet entry."""
INCOME = "income"
EXPENSE = "expense"
class UserRegister(BaseModel):
"""Schema for user registration."""
username: str
email: str
password: str
class UserLogin(BaseModel):
"""Schema for user login."""
username: str
password: str
class UserResponse(BaseModel):
"""Schema for user response."""
id: int
username: str
email: str
created_at: datetime
class Config:
from_attributes = True
class WalletEntryCreate(BaseModel):
"""Schema for creating a wallet entry."""
amount: float
entry_type: EntryType
description: str
class WalletEntryUpdate(BaseModel):
"""Schema for updating a wallet entry."""
amount: Optional[float] = None
entry_type: Optional[EntryType] = None
description: Optional[str] = None
class WalletEntryResponse(BaseModel):
"""Schema for wallet entry response."""
id: int
user_id: int
amount: float
entry_type: EntryType
description: str
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
class DashboardMetrics(BaseModel):
"""Schema for dashboard metrics."""
total_balance: float
total_income: float
total_expenses: float
entry_count: int
class TokenResponse(BaseModel):
"""Schema for token response."""
access_token: str
token_type: str
user: UserResponse