from apis.database import db, dbmodels

def addScore(scoreObj):
    obj = dbmodels.scores(scoreObj['date'], scoreObj['score'], scoreObj['dayBonus'], False, False, False)
    db.session.add(obj)
    db.session.commit()

def updateScore(scoreObj):
    db.session.add(scoreObj)
    db.session.commit()
    
def getScoreDate(date):
    ret = dbmodels.scores.query.filter_by(date = date).first()
    return ret
