[英]How to Design Optimal Database Design to Handle Subscription And Its Usage
What would be a optimal solution to design database to handle Subscriptions 什么是设计数据库以处理订阅的最佳解决方案
Eg I have subscription plans which consists of : 例如,我有以下订阅计划:
Price 价钱
Validity : eg 6 months, 1 Month 有效期:例如6个月1个月
How to track the usage and maintain history of the user's subscriptions. 如何跟踪用户订阅的使用情况和历史记录。
Manage Renewals / Expire Plans 管理续订/到期计划
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...) PaymentTypes(现金,卡,比特币等)
PaymentHistory (can track failure & success in 1 table) PaymentHistory(可以在1个表中跟踪失败和成功)
I have listed the entities based on my understanding, HTH 我已根据我的理解列出了实体
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.