Reputation: 165
What would be a optimal solution to design database to handle Subscriptions
E.g
I have subscription plans which consists of :
Price
Validity : e.g 6 months, 1 Month
How to track the usage and maintain history of the user's subscriptions.
Manage Renewals / Expire Plans
Upvotes: 1
Views: 2145
Reputation: 7854
You should have the following tables
Customers
Subscriptions
Price plans (references subscription)
Price plan line items (references price plan)
Customersubscriptions (references customers and subscription)
CustomerSubscriptionHistory
Credit types
CustomerCredits (references customer & credit types)
CustomerCreditHistory
Invoice ( reference customer)
PaymentTypes (cash, card, bitcoins etc...)
PaymentHistory (can track failure & success in 1 table)
I have listed the entities based on my understanding, HTH
Upvotes: 3