CoinRoster / slotmachine

fruitgame
0 stars 0 forks source link

admin page - dividends transactions table #43

Closed RiskingTime closed 6 years ago

RiskingTime commented 6 years ago

see explanation #41

@Patrick-Bay if necessary, can you provide a summary of what needs to be done, with a estimate of time required?

Patrick-Bay commented 6 years ago

For this update I will need to add a new field to the investments table (most likely a JSON object), in order to store these statistics with the investment for the current period, and then add a new API function to retrieve the desired data. This will be added to the investment plugin. Then we will need to update the dividend payment process to store these aggregate values during the dividend payment process:

https://github.com/CoinRoster/slotmachine/blob/318929d982e402f54440703cbc5e78d7c9750b51/node/investment_plugin.js#L77

Finally, new functionality to generate the table will be added to the admin page code in order to build and display the table.

I would estimate this to take approximately 3 hours to complete.

To recap:

RiskingTime commented 6 years ago

things to add

Patrick-Bay commented 6 years ago

As mentioned in a previous comment, this work involve mainly updates to the investment plugin and the addition of a new table to the admin page and source code.

I would break this into two pieces consisting of 3 hours each (6 hours total):

  1. To facilitate the storage of some of the generated information, create a new database table for dividend payment process histories (each row would store the calculations generated during the dividend payment process each time it's triggered). Create the front-end display for the desired data items from either this table or using existing database rows where such data is already being stored (e.g. individual user dividend payments over time)
  2. Create the investment affiliate calculation, as well as code to credit investment affiliates, and insert it into the dividend payment process. This will probably require additional functionality to be added to the affiliate plugin.

Prior to embarking on this task I would extract the dividend payment process into its own file and include it in the investment plugin as an external module. This will allow us to begin the process of breaking up some of the larger sections of code such as the one being affected here.

RiskingTime commented 6 years ago

yes, please proceed,

Patrick-Bay commented 6 years ago

Minor revision and notes:

Move Dividend Transactions table before balance sheet on Admin page. When crediting dividend affiliates, immediately update affiliate account available balance (not investment since affiliate may no have one)

Patrick-Bay commented 6 years ago

The updates have been committed (https://github.com/CoinRoster/slotmachine/commit/2bdbde06dcbe58c392398ed163b1a6b57b255d84) and pushed to the development server where they may be reviewed now. Please note that the database hasn't been cleared for testing yet so there will be some incorrect or missing items in the transaction histories (simply missing data in previous versions of this update).

RiskingTime commented 6 years ago

ok thanks, I'm closing this issue for now, but I will continue to test and monitor. I will post/update issues for related bugs/functions that came up while working on this issue