What would be a optimal solution to design database to handle Subscriptions
设计数据库来处理订阅的最佳解决方案是什么
E.g I have subscription plans which consists of :
E。g I的认购计划包括:
-
Price
价格
-
Validity : e.g 6 months, 1 Month
有效性:e。g 6个月,1个月
- Credits : E.g 100, 1 Credit/Booking
- 学分:E。100 g,1信贷/预订
How to track the usage and maintain history of the user's subscriptions.
Manage Renewals / Expire Plans
如何跟踪用户订阅的使用和维护历史记录。管理续订/过期计划
1 个解决方案
#1
2
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
CustomerSubscriptionHistory
-
Credit types
信贷类型
-
CustomerCredits (references customer & credit types)
客户信用(参考客户及信用类型)
-
CustomerCreditHistory
CustomerCreditHistory
-
Invoice ( reference customer)
发票(参考客户)
-
PaymentTypes (cash, card, bitcoins etc...)
付款类型(现金、卡、比特币等)
-
PaymentHistory (can track failure & success in 1 table)
PaymentHistory(可以在表1中跟踪失败和成功)
I have listed the entities based on my understanding, HTH
根据我的理解,我列出了这些实体
#1
2
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
CustomerSubscriptionHistory
-
Credit types
信贷类型
-
CustomerCredits (references customer & credit types)
客户信用(参考客户及信用类型)
-
CustomerCreditHistory
CustomerCreditHistory
-
Invoice ( reference customer)
发票(参考客户)
-
PaymentTypes (cash, card, bitcoins etc...)
付款类型(现金、卡、比特币等)
-
PaymentHistory (can track failure & success in 1 table)
PaymentHistory(可以在表1中跟踪失败和成功)
I have listed the entities based on my understanding, HTH
根据我的理解,我列出了这些实体