1.2 KiB
I have introduced a new table called transactions, @schemas/table_transactions.md
I need all RC related transactions logged in here. This is to keep track of all purchases of RC, spendings of RC and withdrawals of RC in track.
I have added my first record with remarks of 'supply',to acc id:1. a large sum.
All purchases of RC (in purchases rc api endpoint) will be deducted from acc id:1 and given to the requested user.
During reward distribution, Record the bet fee going to the acc id:1 and prize going to the winner seperately. and set match_id on reward distribution .
Heres how a RC purchase record would look like
from: 1 to: requested_user_id amount: requested_amount remarks: purchase
Heres how a reward distribution would look like.
from a single players POV (there are 2 players per match). PS: bet fee is usually 10%, stored in settings table entry record 1/2
from: user_id to: 1 amount: entry fee - bet fee remarks: entry_hold match_id: match_id
entry record 2/2
from: user_id to: 1 amount: bet fee remarks: entry_fee match_id: match_id
And for giving the reward.
from: 1 to: winner_user_id amount: (already calculated properly) remarks: reward match_id: match_id