I would like to have relationships:
- users
- accounts
- cards
- banks
- credit_processors.
The question is how to design the model in the db. I got into a confusion when these scenarios came across:
- A card can be issued by a bank and the bank would link the card to a credit processor for instance, Chase would use Visa on their cards, Bank of America would use Mastercard and Visa on their cards.
- A card can be issued by a credit processor WITHOUT a bank for instance, Visa can issue their own cards, American Express can issue their own cards.
When the relationships in the db would be like this:
an account belongs to a bank and can have a credit processor through the bank
an account belongs to a credit processor directly without a bank.
Here is the link to my db diagram. Is there a better way to design this db diagram?