membership_plans

This table contains all the valid plans which a user can purchase or get a reward against. Each plan defines how much credit is to be given to a user along with other details.

The table is incorrectly names as membership_plans. It has a record of all the plans be it for rewards or membership.


Model

FieldTypeNullable

id

varchar

old_id

int4

payable_amount

int8

credits_amount

int8

credits_per_usage

int4

wallet_for

varchar

data

json

expiry_days

int4

is_active

bool

created_at

timestamp

updated_at

timestamp

Description of fields

id

This is the unique text identifier that describes the plan. Each plan shall be named in a way that it's easy to understand about it's expected behavior from this field.

old_id

This is former id in CsSubscriptionPlans. We are no longer using it in the app.

This field can be removed.

payable_amount

If the plan is a membership plan, this value should contain a valid number. This field contains the amount to be paid by a user to purchase this plan. This unit of the field is Indian rupees and must be a multiple of thousand. If a plan is for ₹20, the value should be 20000.

credits_amount

This represents the amount credit to a user. If it's a membership plan, the amount is credited after user has purchased and added to their membership wallet (silver tokens). If it's a reward plan, the amount is credited after the activity completion and added to their reward wallet (gold tokens). This field is also should be a multiple of thousand and the unit is in tokens.

credits_per_usage

This field represents the credits to be deducted for that plan against the usage of the app. While we still utilize this field at some places, this is redundant because:

  1. The app has a fixed credit per usage, i.e., 4 tokens per usage. Currently all the plans have 4000 value set against them.

  2. We used to have a per user membership table where the intent was to store the active membership plan for a user. That concept was removed as user can buy or receive any number of tokens and it will keep adding to their wallet.

wallet_for

This represents the wallet type that this plan will work for. It has two possible values: membership and rewards.

data

Redundant field. Null for all.

This field can be removed.

expiry_days

This field tells the number of days after which the plan will expire. -1 is never.

This field was also intended to use where each user can have a membership plan purchased, however because the concept was dropped, this field is also not being used.

This field can be removed.

is_active

This tells whether the plan is active or not. This is also not being used at all as currently all plans are active.

This field can be removed.

created_at

The date at which the plan was created.

updated_at

The date at which the plan was last updated.

Last updated