Automated Action 2c6298ca4b Implement fintech payment service backend with FastAPI and SQLite
- Set up project structure with FastAPI
- Implement user and account management
- Add send and receive money functionality
- Set up transaction processing system
- Add JWT authentication
- Configure SQLAlchemy with SQLite
- Set up Alembic for database migrations
- Create comprehensive API documentation
2025-06-17 11:53:41 +00:00

43 lines
892 B
Python

from pydantic import BaseModel
from typing import Optional
from datetime import datetime
from enum import Enum
class AccountType(str, Enum):
SAVINGS = "savings"
CHECKING = "checking"
INVESTMENT = "investment"
class AccountBase(BaseModel):
account_type: AccountType
currency: str = "USD"
class AccountCreate(AccountBase):
"""Request model for creating a new account"""
pass
class AccountUpdate(BaseModel):
"""Request model for updating an existing account"""
account_type: Optional[AccountType] = None
currency: Optional[str] = None
class AccountInDBBase(AccountBase):
id: int
account_number: str
owner_id: int
balance: float
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
class Account(AccountInDBBase):
"""Response model for account data"""
pass