-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add a one billing period free trial #149
Conversation
This will run a empty metering on the first bill and archive the usage records. After the first billing period the adapter will begin billing usage as normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is hard coded to one billing period but could be easily extended to allow for a configurable trial period length. |
Yeah I noticed that. Would just have to have a means for passing in the value for the initialisation of the cache settings to pick it up... Of course if the cache ever gets deleted and then recreated, it would result in an additional trial period, right? |
Yes. It would be the same issue even if the trial period were calculated from the adapter start date though. Since the start date is stored in the cache. It would get reset as well. |
Updated base to staging branch. |
I think we can add a second check on the length of the billing record history.
where |
It would work as it is now with a trial period of 1. However, if the period was configurable we'd need another value trial_period_length to calculate archive > trial_period_length. For now it's fine though. Do we want to mark the adapter status as "not compliant"? or only post a warning message? |
We want "not compliant". |
If archive exists raise error as free trial should be disabled. Error is added to csp config to propagate adapter error to product.
Added archive comparison. Adds error to csp config if archive exists and free trial is still active. In this case the adapter will ignore the free trial flag and bill as normal. The error will be available to products via csp config. |
Thanks, LGTM |
This will run a empty metering on the first bill and archive the usage records. After the first billing period the adapter will begin billing usage as normal.