omeruzer Mesela şöyle olabilir; çok basit düzeyde modeller:
Plan
+----+-------+
| id | name |
+----+-------+
| 1 | Basic |
| 2 | Pro |
+----+-------+
Feature
+----+--------------+------------+-------+
| id | name | unit | price |
+----+--------------+------------+-------+
| 1 | SMS | per_usage | 0.5 |
| 2 | Mail | per_usage | 0.1 |
| 3 | Video Render | per_minute | 1.25 |
+----+--------------+------------+-------+
Subscription
+----+---------+---------+---------------------+---------------------+----------+------------+
| id | plan_id | user_id | starts_at | ends_at | is_trial | recurrence |
+----+---------+---------+---------------------+---------------------+----------+------------+
| 1 | 1 | 3 | 2022-09-21 11:44:42 | 2022-10-21 11:44:42 | false | monthly |
+----+---------+---------+---------------------+---------------------+----------+------------+
SubscriptionFeature
+-----------------+------------+------------+-------+
| subscription_id | feature_id | usage | price |
+-----------------+------------+------------+-------+
| 1 | 1 | per_usage | 0.5 |
| 1 | 2 | per_usage | 0.2 |
| 1 | 3 | per_minute | 2.15 |
+-----------------+------------+------------+-------+
PlanFeature
+---------+------------+
| plan_id | feature_id |
+---------+------------+
| 1 | 1 |
| 1 | 2 |
| 1 | 3 |
+---------+------------+
FeatureUsage
+-----------------+------------+---------+-------+
| subscription_id | feature_id | user_id | usage |
+-----------------+------------+---------+-------+
| 1 | 1 | 1 | 1 |
| 1 | 3 | 1 | 15 | // Basic planda 15 dk video render etmiş
+-----------------+------------+---------+-------+