Exemple #1
0
class GameInvites(db.Model):
    __tablename__ = "game_invites"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    status = db.Column(db.Enum(GameInviteStatusTypes))
    timestamp = db.Column(db.Float(precision=32))
Exemple #2
0
class ExternalInvites(db.Model):
    __tablename__ = "external_invites"

    id = db.Column(db.Integer, primary_key=True)
    requester_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    invited_email = db.Column(db.Text)
    status = db.Column(db.Enum(ExternalInviteStatus))
    timestamp = db.Column(db.Float(precision=32))
    type = db.Column(db.Enum(ExternalInviteTypes))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
Exemple #3
0
class Orders(db.Model):
    __tablename__ = "orders"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    symbol = db.Column(db.Text)
    buy_or_sell = db.Column(db.Enum(BuyOrSell))
    quantity = db.Column(db.Integer)
    price = db.Column(db.Float(precision=32))
    order_type = db.Column(db.Enum(OrderTypes))
    time_in_force = db.Column(db.Enum(TimeInForce))
Exemple #4
0
class Winners(db.Model):
    __tablename__ = "winners"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    winner_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    benchmark = db.Column(db.Enum(Benchmarks))
    score = db.Column(db.Float(precision=32))
    start_time = db.Column(db.Float(precision=32))
    end_time = db.Column(db.Float(precision=32))
    payout = db.Column(db.Float(precision=32))
    type = db.Column(db.Enum(PayoutType))
    timestamp = db.Column(db.Float(precision=32))
Exemple #5
0
class GameBalances(db.Model):
    __tablename__ = "game_balances"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    game_id = db.Column(db.Integer, db.ForeignKey("games.id"))
    order_status_id = db.Column(db.Integer, db.ForeignKey("order_status.id"))
    stock_split_id = db.Column(db.Integer, db.ForeignKey("stock_splits.id"))
    dividend_id = db.Column(db.Integer, db.ForeignKey("dividends.id"))
    timestamp = db.Column(db.Float(precision=32))
    balance_type = db.Column(db.Enum(GameBalanceTypes))
    balance = db.Column(db.Float(precision=32))
    symbol = db.Column(db.Text)
    transaction_type = db.Column(db.Enum(GameBalanceTransactionTypes))
Exemple #6
0
class Indexes(db.Model):
    __tablename__ = "indexes"

    id = db.Column(db.Integer, primary_key=True)
    symbol = db.Column(db.VARCHAR(255), db.ForeignKey("index_metadata.symbol"))
    value = db.Column(db.Float(precision=32))
    timestamp = db.Column(db.Float(precision=32))
Exemple #7
0
class GameStatus(db.Model):
    __tablename__ = "game_status"

    id = db.Column(db.Integer, primary_key=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
    status = db.Column(db.Enum(GameStatusTypes))
    users = db.Column(db.JSON)
    timestamp = db.Column(db.Float(precision=32))  # When was the game opened
Exemple #8
0
class Transactions(db.Model):
    __tablename__ = "order_status"

    id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer, db.ForeignKey("orders.id"), nullable=True)
    timestamp = db.Column(db.Float(precision=32))
    status = db.Column(db.Enum(OrderStatusTypes))
    clear_price = db.Column(db.Float(precision=32), nullable=True)
Exemple #9
0
class StockBetsRating(db.Model):
    __tablename__ = "stockbets_rating"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer,
                        db.ForeignKey("users.id"),
                        nullable=True,
                        index=True)
    index_symbol = db.Column(db.VARCHAR(255),
                             db.ForeignKey("index_metadata.symbol"),
                             nullable=True)
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
    rating = db.Column(db.Float(precision=32))
    basis = db.Column(db.Float(precision=32))
    total_return = db.Column(db.Float(precision=32))
    n_games = db.Column(db.Integer)
    update_type = db.Column(db.Enum(EventTypes))
    timestamp = db.Column(db.Float(precision=32))
Exemple #10
0
class Payments(db.Model):
    """This table handles real payments -- this isn't virtual currency, but an actual record of cash liabilities vis-a-
    vis the platform=
    """
    __tablename__ = "payments"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    profile_id = db.Column(db.Integer, db.ForeignKey("payment_profiles.id"))
    game_id = db.Column(db.Integer, db.ForeignKey('games.id'), nullable=True)
    winner_table_id = db.Column(db.Integer,
                                db.ForeignKey("winners.id"),
                                nullable=True)
    type = db.Column(db.Enum(PaymentTypes))
    amount = db.Column(db.Float(precision=32))
    currency = db.Column(db.Enum(CurrencyTypes))
    direction = db.Column(db.Enum(PaymentDirection))
    timestamp = db.Column(db.Float(precision=32))
Exemple #11
0
class PaymentProfiles(db.Model):
    __tablename__ = "payment_profiles"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    processor = db.Column(db.Enum(Processors), index=True)
    uuid = db.Column(db.VARCHAR(255), index=True)
    payer_email = db.Column(db.Text, nullable=True)
    timestamp = db.Column(db.Float(precision=32))
Exemple #12
0
class Games(db.Model):
    __tablename__ = "games"

    id = db.Column(db.Integer, primary_key=True)
    creator_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    title = db.Column(db.Text)
    game_mode = db.Column(db.Enum(GameModes))
    duration = db.Column(db.Integer)
    buy_in = db.Column(db.Float(precision=32))
    benchmark = db.Column(db.Enum(Benchmarks))
    side_bets_perc = db.Column(db.Float(precision=32))
    side_bets_period = db.Column(db.Enum(SideBetPeriods))
    invite_window = db.Column(db.Float(precision=32))
    stakes = db.Column(db.Enum(GameStakes), nullable=True)
Exemple #13
0
class Friends(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    requester_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    invited_id = db.Column(db.Integer, db.ForeignKey("users.id"))
    status = db.Column(db.Enum(FriendStatuses))
    timestamp = db.Column(db.Float(precision=32))