Add ability for admin to renew trial
Problem
From #1173
The extend trial feature was implemented in https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/372 but our team members have not seen this option on any expired trials.
Note: the option to extend trials by changing the end date does appear for active trials.
Example
The group https://gitlab.com/groups/this-trial-wont-work/-/billings has a trial that expired 2019-06-13, but there's no options that I can see that would allow me to:
- Know that a trial existed but has since expired
- Extend that trial
Interestingly, even though Lyle started a new trial
#<Order:0x000000000bfbfb48
id: 56044,
customer_id: 8334,
product_rate_plan_id: "2c92a0fc5a83f01d015aa6db83c45aac",
subscription_id: nil,
subscription_name: nil,
start_date: Tue, 11 Feb 2020,
end_date: Wed, 12 Feb 2020,
quantity: 1,
created_at: Tue, 11 Feb 2020 00:55:46 UTC +00:00,
updated_at: Tue, 11 Feb 2020 00:56:24 UTC +00:00,
gl_namespace_id: "7139776",
gl_namespace_name: "will-this-trial-work",
amendment_type: nil,
trial: true,
last_extra_ci_minutes_sync_at: nil,
zuora_account_id: nil,
increased_billing_rate_notified_at: nil>
The expired date is still the original. Nevertheless, I'm certain that more than one of Lyle's groups have had trials and none of them are showing previous expiration dates or the option to extend: https://customers.gitlab.com/admin/customer/8334/list_gitlab_namespaces
Please see @lyle's comments for more details: https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/372#note_284557673
This issue will be resolved when
Note: displaying the date of a previously expired trial is being worked on in #1173
When team members have the ability to:
- Reactivate and extend expired trials
- A team member will select a "renew trial" button
- The button will automatically reactivate the trial with Gold plan and an end date 2 weeks from current date
- Once reactivated, team member can select different plan and end date as with any active trial
- Note: team members should be able to reactive any trial regardless of its age
Solution wireframe:
Step 1 | Step 2 |
---|---|
Technical considerations
As noted in https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/1576#note_380200751
would be much easier to implement if we know which orders were created as a trial originally, and being able to check if a trial
is true
would help validate not accidentally changing a non-trial order.
From #1643 (comment 372870393)
finding the original order for the trial may be somewhat problematic because the trial_histories
table doesn't include the order ID.
Ideally, when the trial expires, the data is not edited so that the order keeps the original end date and that it was tied to a trial.
Nevertheless, even in the current state of things, we could potentially use the fact that trials are the only type of order not tied to a purchase transaction to find the relevant order:
subscription_id: nil,
subscription_name: nil
The function could be a modified version of what support currently use via console, specifying gold plan and the current date + 2 weeks for the trial end date, as long as we also add the validation above.
Potential Solution
- Add 'order_id' to trials history table
- in Customers admin reference the trials history table for to check for expired trials for that particular namespace.
- If an expired trial is found add a "reactivate trial" button and default the value to +14 days from current date. Once the trial is active, the admin should have the ability to adjust the date even further as needed, note the further adjustment of active trials should be a feature that's already live via https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/372
- When extending a trial is extended we update the trials table with the updated trial end date
- Update other relative systems/tables to ensure the trial is properly extended to the new end date
Prioritization
Deprioritized in favour of gitlab#290278 (closed)