Panoramic View

Explaination in Details

Subscription Plan

The master table for subscription, stores system level subscription plans, currently there only have three entity rows inside refer to requirement: Smart(99PHP), Growth(199PHP) and All-star(299PHP).

upgrades_to field stores the subscription plan value for this level upgrades to.

Subscription operation

This table used for store the free operation types, free usage counts and above limit fees for each subscription plans.

Customer subscription

This table is the relations between customers and subscription plans.

  • customer_id from customer and subscription_plan_id for subscription plan, the two ids compose the unique key for this table. Autodebit_date is used to store next auto-debit date, see also:Set autodebit date .

  • Usage_reset_at while refresh to current timestamp automatically when user activated a new subscription plan, autodebit or upgrade subscription plan. Based onChange subscription plan , upgrade will take effect immediately but downgrade will take effect on next autodebit date.

  • scheduled_upgrade_to_plan_id will store next downgrade plan id.

Subscription operation usage

This table stores each operation usage. The algorithm of rest free usage count is <free_usage_account> - sum(<times_used> later than <usage_reset_at> )

Subscription fee transaction

Each time costomer renewal their subscription, will generate a new record into this table. If customer decide to waive, beside record to waived_subscription_fee_transaction, will also update the waived transaction id into reverted_by_id.

Waived subscription fee transaction

Record for customer waived operation.

Attachments:

SubscriptionInPanoramic.drawio.png (image/png)
SubscriptionInPanoramic.drawio (application/vnd.jgraph.mxfile)
~SubscriptionInPanoramic.drawio.tmp (application/vnd.jgraph.mxfile)