Automated Action 0cd6e6441d Setup FastAPI REST API for Sports Betting Verification
- Set up FastAPI application structure
- Implemented SQLite database integration with SQLAlchemy
- Added Alembic migrations for database versioning
- Created bet model and API endpoints for CRUD operations
- Added comprehensive README with setup and usage instructions
- Added health check endpoint and CORS support
2025-06-07 13:06:19 +00:00

46 lines
855 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
# Shared properties
class BetBase(BaseModel):
user_id: str
event_id: str
amount: float = Field(..., gt=0)
odds: float
prediction: str
# Properties to receive on item creation
class BetCreate(BetBase):
pass
# Properties to receive on item update
class BetUpdate(BaseModel):
is_verified: Optional[bool] = None
result: Optional[str] = None
# Properties shared by models stored in DB
class BetInDBBase(BetBase):
id: int
is_verified: bool
created_at: datetime
verified_at: Optional[datetime] = None
result: Optional[str] = None
class Config:
orm_mode = True
# Properties to return to client
class Bet(BetInDBBase):
pass
# Properties stored in DB
class BetInDB(BetInDBBase):
pass