简体   繁体   English

如何设计最佳的数据库设计来处理订阅及其使用

[英]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个月

  • Credits : Eg 100, 1 Credit/Booking 学分:例如100,1学分/预订

How to track the usage and maintain history of the user's subscriptions. 如何跟踪用户订阅的使用情况和历史记录。
Manage Renewals / Expire Plans 管理续订/到期计划

You should have the following tables 您应该有下表

  1. Customers 顾客

  2. Subscriptions 订阅

  3. Price plans (references subscription) 价格计划(参考订阅)

  4. Price plan line items (references price plan) 价格计划订单项(参考价格计划)

  5. Customersubscriptions (references customers and subscription) 客户订阅(参考客户和订阅)

  6. CustomerSubscriptionHistory CustomerSubscriptionHistory

  7. Credit types 信用类型

  8. CustomerCredits (references customer & credit types) 客户信贷(引用客户和信贷类型)

  9. CustomerCreditHistory CustomerCreditHistory

  10. Invoice ( reference customer) 发票(参考客户)

  11. PaymentTypes (cash, card, bitcoins etc...) PaymentTypes(现金,卡,比特币等)

  12. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM