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

20 lines
720 B
Python

from datetime import datetime
from sqlalchemy import Boolean, Column, Float, Integer, String, DateTime
from app.db.base_class import Base
class Bet(Base):
"""
Model representing a sports bet.
"""
id = Column(Integer, primary_key=True, index=True)
user_id = Column(String, index=True)
event_id = Column(String, index=True)
amount = Column(Float, nullable=False)
odds = Column(Float, nullable=False)
prediction = Column(String, nullable=False)
is_verified = Column(Boolean, default=False)
created_at = Column(DateTime, default=datetime.utcnow)
verified_at = Column(DateTime, nullable=True)
result = Column(String, nullable=True) # "win", "loss", "push", "void", etc.