
- 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
33 lines
544 B
Python
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 |