Reputation: 75
Good Day,
I'm currently designing database structure for a website of mine. I need community assistance in one aspect only as I never did something similar.
Website will include three types of the payments:
Basically, I need some tips to get the best design possible.
Here's what I'm thinking about:
deposits
- this table will store info about deposits
deposits_data
- this table will store info about deposit transaction (ex. data returned by PayPal IPN)
payments
- table to store internal payments
withdrawals
- table to store info about withdrawal request
transactions
- table to store info about ALL transactions (with ENUM() field called type with following values possible: internal, deposit, withdrawal)
Please note that I have already a table logs
to store every user action.
Unfortunately, I feel that my design approch is not the best possible in this aspect. Can you share some ideas/tips?
PS. Can I use a name "escrow" for internal payments or should I choose different name?
Edit
DEPOSITS
, PAYMENTS
and WITHDRAWALS
tables store specific transaction details. TRANSACTIONS
table stores only limited info - it's a kind of logs table - with a details
field (which contains a text to display in user log section, ex: "User 1 sent you a payment for something")/
Of course I have users tables, etc.
Upvotes: 2
Views: 1488
Reputation: 146179
Can I use a name "escrow" for internal payments or should I choose different name?
Escrow has a specfic financial/legal meaning, which is different from how you seem to mean it: "a written agreement (or property or money) delivered to a third party or put in trust by one party to a contract to be returned after fulfillment of some condition" (source)
So choosing a different name seems like a good idea.
As for design, what data will DEPOSITS, PAYMENTS and WITHDRAWALS store which TRANSACTIONS won't? Also, you need an ACCOUNTS table. Or are you planning to just use your existing USERS table (I presume you have such a thing)? You probably ought to have something for external parties, even if you only intend to support PayPal for the time being.
Upvotes: 1