Intiger

  

hi so im creating an app whereby users can share coins and purchase using the same coins.these coins move from one user to another.so basically when a user decides to share a certain amount of coins to another user his coin account gets a deduction of the amount he chose to donate or give off.

so basically my problem is having the donator/giver/buyer to has his coins deducted at the same time when he gives/donate/buy. and get the guy whos gets the coin earn those coins appeared on his account on the app.its basically a number game

can you help me get through this plase 

thank you 

Hello Musa Popo!

What part of this application are you having trouble with?  If the data model, I would look into double entry accounting, unless you do not need to maintain a ledger.

Hi Musa,

it seems very straight requirement of maintaining accounting information for each transaction. You need to make a debit entry in givers\donators account and a credit entry in the receivers account.

Again my question is same as Craig where exactly you are facing trouble ? with the db design or in logics?


Regards

-PJ-

Musa Popo wrote:

hi so im creating an app whereby users can share coins and purchase using the same coins.these coins move from one user to another.so basically when a user decides to share a certain amount of coins to another user his coin account gets a deduction of the amount he chose to donate or give off.

so basically my problem is having the donator/giver/buyer to has his coins deducted at the same time when he gives/donate/buy. and get the guy whos gets the coin earn those coins appeared on his account on the app.its basically a number game

can you help me get through this plase 

thank you 

Hi Musa,

You can design UserAccount table with CreditDebit as static table and keep every single entry for Credit & Debit. 


Another way, You can design UserAccount table and can have Balance attribute in it. In this case you always have to update the balance column for every credit & debit.

These are very simple ERD which i take just for example. 

Sachin