Automated Action 4cfc9775ae Create betting application API with FastAPI and SQLite
- Set up project structure with FastAPI and SQLite
- Implement user authentication with JWT
- Create database models for users, events, bets, and transactions
- Add API endpoints for user management
- Add API endpoints for events and betting functionality
- Add wallet management for deposits and withdrawals
- Configure Alembic for database migrations
- Add linting with Ruff
- Add documentation in README
2025-06-02 15:02:41 +00:00

33 lines
544 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel
from app.models.bet import BetStatus
class BetBase(BaseModel):
amount: float
odds: float
potential_win: float
class BetCreate(BaseModel):
outcome_id: int
amount: float
class BetUpdate(BaseModel):
status: BetStatus
class Bet(BetBase):
id: int
user_id: int
outcome_id: int
status: BetStatus
settled_at: Optional[datetime] = None
created_at: datetime
class Config:
from_attributes = True