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

Expected sales until end of month should only include "AUTO_RENEW" licenses #4

Open
spraot opened this issue Oct 29, 2015 · 3 comments

Comments

@spraot
Copy link
Contributor

spraot commented Oct 29, 2015

Most server licenses are AUTO_QUOTE, and extensions for these are often purchased several months before or after expiry, or not at all.

In the case of server licenses, the prediction is actually not very good at all, and it might be better just to project that the remaining business days in the month will have the same amount of sales as the average for the past few months.

@spraot
Copy link
Contributor Author

spraot commented Nov 3, 2015

Also, the number is not correct for server addons, since when a server addon is renewed, the price is only half of the original price. Actually, even that cannot be relied on, since the user may not have bought exactly one year of maintenance originally (two years is common). To be correct, we would have to get the current sale price from the marketplace API.

@thecatontheflat
Copy link
Owner

@rachetfoot If you could give me a logic (in pseudo-code or in diagram) for calculation of expected sales till the end of month or quarter or year — it would help me to build a proper implementation

@spraot
Copy link
Contributor Author

spraot commented Nov 7, 2015

Something like the following would probably be pretty reasonable as a sort of "minimum expected renewals", although this number will be quite far from the total amount of sales, so it is still only of limited use. In general, sales fluctuate a lot from month to month for server addons, and are therefore hard to predict.

I'm pretty sure we can get the price from API 2.0, although I think it's still in beta.

licenses = licenses WHERE expiry between now and end of month AND license.renewal == AUTO_RENEW
sum = 0
for license in licenses {
  licensePrice = price from marketplace API
  if license.key ends with "ondemand" {
    sum += licensePrice
  } else {
    sum += licensePrice/2
  }
}

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

No branches or pull requests

2 participants