-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Your implementation is missing a key part of the whole bank thing.
Transactions happend between two accounts, your ledger cannot be only an array of strings. You will end up costing money.
My sugestion is:
- Add a reference to the account in transaction
Reason:
You need the contexto of what account that transaction belongs.
-
Add type to the transaction
It is a debit or a credit transaction? -
Transaction should reference the account and not the taxId.
One person can have multiple accounts. The transaction is all about the account.
The perception is kind of crossed.
An Account will have many transactions, so the account will not reference transaction but the oposit.
When user A sends money to User B, what happends? How many transactions are created and in whitch accounts. Think on that foward.
We have some articles about that.