CoinRoster / slotmachine

fruitgame
0 stars 0 forks source link

Update transaction history storage and display #32

Closed Patrick-Bay closed 6 years ago

Patrick-Bay commented 6 years ago

Affiliate balance in the account history currently only shows the affiliate earnings for the user. This value should show the user's in-game or available balance as adjusted with the affiliate earnings.

Affiliate earnings should be stored and only credited to the user's available balance during the nightly dividend payment.

Update gaming.accounts table to include new column to explain transaction type and include details so that we can use this information to build transaction history table instead of using correlated data streams from other tables.

In this data we should include:

Update server code to include transaction type when storing the transaction in account table. This will include any function that updates this table (global.updateAccount or "INSERT INTO gaming.accounts SQL statement).

Restart server and test all associated functionality to ensure values are being added:

Update client-side account history generator (buildTransactionsTable in account.js) to include the following history items:

"Bet" "Win" "Gameplay Affiliate" -- Affiliate Earning aggregate from game play (end-of-day) "Investment Affiliate" --- Affiliate Earning from investments/bankroll earnings (end-of-day) Any account "Withdrawals" or "Deposits" not already listed as Bets and Wins (i.e. global or system-wide transactions) "Investment Withdrawal" --- Any withdrawal made from an investment "Investment Deposit" --- Any deposit made to an investment

Test to ensure values are appearing correctly and that available user balance is correctly reflected at each step.

Patrick-Bay commented 6 years ago

Review with James after database / server code updates.

Patrick-Bay commented 6 years ago

Server updates are expected to take about 1 hour and the client updates and revisions an additional hour (2 hours total).

RiskingTime commented 6 years ago

please proceed

Patrick-Bay commented 6 years ago

The RPC_getAccountTransactions function in game_server.js will need to be updated prior to clients-side updates to return only accounts table information instead of collating multiple tables.

RiskingTime commented 6 years ago

Let's review this in person on tuesday

Patrick-Bay commented 6 years ago

The update for this issue has been included in the latest commit (https://github.com/CoinRoster/slotmachine/commit/1e9bf070cb25734bebc5c4b10ab0d6169a0c2040). However, I will need an additional two hours to complete the affiliate portion after we've had a chance to more thoroughly define the dividend calculations today.

Patrick-Bay commented 6 years ago

As a caveat I should mention that any transactions prior to this update are omitted from the display as having "unrecognized" histories although they still appear in the database (the new tx_info field has no entries in the database).

Patrick-Bay commented 6 years ago

Remaining updates:

Remove the "investments" array for all transaction records that are non-investment related (we're only using the available balance display).

Create documentation for James (and others), to explain in detail the dividend payment process, location of associated files and code entry points. Include diagrams to illustrate relationships between database fields and variables, logic flow, mathematical operations, etc.

RiskingTime commented 6 years ago

please proceed with this

RiskingTime commented 6 years ago

my account transaction history

transactions missing from the account history, see link below to compare

https://testnet.blockchain.info/address/mpHdh1FsEWLhPgHw7dQohzMRM3tni3DvXU

Patrick-Bay commented 6 years ago

This may be related to multiple subsequent deposits.