Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
credit
Browse files Browse the repository at this point in the history
  • Loading branch information
Olegogonich committed Nov 24, 2024
1 parent 669b1a9 commit 40e3897
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/backend/src/lib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ def get_data():
event = get_latest_event_from_history(user.history)
answer = event.answers.get(anwser_id)

user.credit += answer.credit

db.set_user_money(_id=user_id, money=user.money + answer.delta_money - user.credit * 0.1)
db.set_user_credit(_id=user_id, credit=user.credit * 0.9 if user.credit * 0.1 >= 100 else 0)
db.set_user_credit(_id=user_id, credit=user.credit * 0.9 if user.credit >= 100 else 0)

db.add_answer_to_user_history(_id=user_id, answer_id=answer._id)

Expand Down

0 comments on commit 40e3897

Please sign in to comment.