Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use trial period on regular plan instead of trial plan #1122

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tdrivas
Copy link
Contributor

@tdrivas tdrivas commented Feb 19, 2025

Current Approach
Currently, we create two separate subscriptions:

  • A Trial Subscription (is_trial=True) that lasts for TRIAL_PERIOD_DAYS.
  • A Paid Subscription that is created after the trial expires.

Problems with this approach:

  • Handling multiple subscriptions for one user
  • Extra logic to fetch, cancel or update trial and regular subscriptions separately.

New Approach

  • User asks for a trial subscription
  • if the user has no remaining organization trials, no subscription is created
  • Otherwise, a subscription object is being created including, among others, a trial_plan, a regular plan and a default number of trial days.
  • The trial subscription becomes active until the end of the trial.
  • When the trial ends and depending on the user input (payment method), the subscription update its status (ACTIVE_ * / INACTIVE_ *)

@duke-nyuki
Copy link
Collaborator

@suricactus suricactus changed the title Use trial period on regular plan instead of trial plan [WIP] Use trial period on regular plan instead of trial plan Feb 19, 2025
Comment on lines 142 to 143
"regular_plan__link",
"trial_plan__link",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to add the admin methods for these two, similar to account__link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My approach is for the list_display to show only the active plan. Since we already have the property plan in the model we can get only the active once. The reasons behind this approach is that it saves space, makes UI cleaner and still allows admins to differentiate trial status via the is_trialing column. If admin wants to see both the regular and trial plans separately, we could add filters.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's discuss it tomorrow. I thought if a column does not exist, as in our case trial_plan__link column does not exist, we need to write a get_trial_plan__link method, but I guess I am wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants