Database table design
Hello Team,
I have (Ticket, Insurance ...etc) models and each of these models is belongs to customer, supplier and agent. when a ticket is created, the following payment transactions happen:
- customer is paying me for the ticket.
- supplier paying me commission.
- I pay agent commission.
same payment transaction is happening when insurance is created as well.
now I am confused, how to design the payment transaction table?! is a good practice if i create 3 tables (customer_transactions, supplier_transactions and agent_transaction) as per below structure?
customer_transactions
id
transactionable_type
transactionable_id,
customer_id
.
.
.
where transactionable_type could be Ticket or Insurance.
appreciate if you share another possibilities for above scenario.
Please or to participate in this conversation.